本文整理汇总了Java中com.sun.tools.javac.code.Symbol.ClassSymbol.members方法的典型用法代码示例。如果您正苦于以下问题:Java ClassSymbol.members方法的具体用法?Java ClassSymbol.members怎么用?Java ClassSymbol.members使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.code.Symbol.ClassSymbol
的用法示例。
在下文中一共展示了ClassSymbol.members方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: alreadyDefinedIn
import com.sun.tools.javac.code.Symbol.ClassSymbol; //导入方法依赖的package包/类
public boolean alreadyDefinedIn(CharSequence name, TypeMirror returnType, List<TypeMirror> paramTypes, TypeElement enclClass) {
ClassSymbol clazz = (ClassSymbol)enclClass;
Scope scope = clazz.members();
Name n = names.fromString(name.toString());
ListBuffer<Type> buff = new ListBuffer<>();
for (TypeMirror tm : paramTypes) {
buff.append((Type)tm);
}
for (Symbol sym : scope.getSymbolsByName(n, Scope.LookupKind.NON_RECURSIVE)) {
if(sym.type instanceof ExecutableType &&
jctypes.containsTypeEquivalent(sym.type.asMethodType().getParameterTypes(), buff.toList()) &&
jctypes.isSameType(sym.type.asMethodType().getReturnType(), (Type)returnType))
return true;
}
return false;
}
示例2: getAllValues
import com.sun.tools.javac.code.Symbol.ClassSymbol; //导入方法依赖的package包/类
/**
* Returns a map from element symbols to their values.
* Includes all elements, whether explicit or defaulted.
*/
private Map<MethodSymbol, Attribute> getAllValues() {
Map<MethodSymbol, Attribute> res =
new LinkedHashMap<MethodSymbol, Attribute>();
// First find the default values.
ClassSymbol sym = (ClassSymbol) anno.type.tsym;
for (Scope.Entry e = sym.members().elems; e != null; e = e.sibling) {
if (e.sym.kind == Kinds.MTH) {
MethodSymbol m = (MethodSymbol) e.sym;
Attribute def = m.getDefaultValue();
if (def != null)
res.put(m, def);
}
}
// Next find the explicit values, possibly overriding defaults.
for (Pair<MethodSymbol, Attribute> p : anno.values)
res.put(p.fst, p.snd);
return res;
}
示例3: computeDefaultSerializableFields
import com.sun.tools.javac.code.Symbol.ClassSymbol; //导入方法依赖的package包/类
private void computeDefaultSerializableFields(DocEnv env,
ClassSymbol def,
ClassDocImpl cd) {
for (Scope.Entry e = def.members().elems; e != null; e = e.sibling) {
if (e.sym != null && e.sym.kind == Kinds.VAR) {
VarSymbol f = (VarSymbol)e.sym;
if ((f.flags() & Flags.STATIC) == 0 &&
(f.flags() & Flags.TRANSIENT) == 0) {
//### No modifier filtering applied here.
FieldDocImpl fd = env.getFieldDoc(f);
//### Add to beginning.
//### Preserve order used by old 'javadoc'.
fields.prepend(fd);
}
}
}
}