本文整理匯總了Java中com.sun.tools.javac.code.Flags.SYNTHETIC屬性的典型用法代碼示例。如果您正苦於以下問題:Java Flags.SYNTHETIC屬性的具體用法?Java Flags.SYNTHETIC怎麽用?Java Flags.SYNTHETIC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.sun.tools.javac.code.Flags
的用法示例。
在下文中一共展示了Flags.SYNTHETIC屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findSuperConstructorInType
/**
* based heavily on {@link ASTHelpers#findSuperMethodInType(Symbol.MethodSymbol, Type, Types)},
* but works for constructors
*/
@Nullable
private static Symbol.MethodSymbol findSuperConstructorInType(
Symbol.MethodSymbol methodSymbol, Type superType, Types types) {
Preconditions.checkArgument(methodSymbol.isConstructor(), "only accepts constructor methods");
Scope scope = superType.tsym.members();
for (Symbol sym : scope.getSymbolsByName(methodSymbol.name)) {
if (sym != null
&& sym.isConstructor()
&& ((sym.flags() & Flags.SYNTHETIC) == 0)
&& hasSameArgTypes((Symbol.MethodSymbol) sym, methodSymbol, types)) {
return (Symbol.MethodSymbol) sym;
}
}
return null;
}
示例2: needsHeader
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) {
if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0)
return false;
for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0)
return true;
for (Attribute.Compound a: i.sym.getDeclarationAttributes()) {
if (a.type.tsym == syms.nativeHeaderType.tsym)
return true;
}
}
if (checkNestedClasses) {
for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true))
return true;
}
}
return false;
}
示例3: verify
void verify(MethodSymbol m, boolean expectNames) {
if ((m.flags() & Flags.SYNTHETIC) != 0 && !testSyntheticMethods)
return;
//System.err.println("verify: " + m.params());
int i = 1;
for (VarSymbol v: m.params()) {
String expectName;
if (expectNames)
expectName = getExpectedName(v, i);
else
expectName = "arg" + (i - 1);
checkEqual(expectName, v.name.toString());
i++;
}
}
示例4: visitTypeVar
@Override
public Void visitTypeVar(TypeVar t, Set<Type> seen) {
if ((t.tsym.flags() & Flags.SYNTHETIC) != 0 && seen.add(t)) {
visit(t.getUpperBound(), seen);
}
return null;
}
示例5: isSynthetic
public boolean isSynthetic(Element e) {
return (((Symbol) e).flags() & Flags.SYNTHETIC) != 0 || (((Symbol) e).flags() & Flags.GENERATEDCONSTR) != 0;
}
示例6: isSynthetic
/**
* Returns true if this class was synthesized by the compiler.
*/
public boolean isSynthetic() {
return (getFlags() & Flags.SYNTHETIC) != 0;
}
示例7: isSynthetic
/**
* Returns true if this field was synthesized by the compiler.
*/
public boolean isSynthetic() {
return (getFlags() & Flags.SYNTHETIC) != 0;
}
示例8: isSynthetic
/**
* Returns true if this field was synthesized by the compiler.
*/
public boolean isSynthetic() {
return ((sym.flags() & Flags.SYNTHETIC) != 0);
}
示例9: isSynthetic
boolean isSynthetic(Symbol sym) {
return (sym.flags() & Flags.SYNTHETIC) != 0;
}
示例10: isSynthetic
/**Returns true if the given element is synthetic.
*
* @param element to check
* @return true if and only if the given element is synthetic, false otherwise
*/
public boolean isSynthetic(Element element) {
return (((Symbol) element).flags() & Flags.SYNTHETIC) != 0 || (((Symbol) element).flags() & Flags.GENERATEDCONSTR) != 0;
}