當前位置: 首頁>>代碼示例>>Java>>正文


Java Flags.SYNTHETIC屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:uber,項目名稱:NullAway,代碼行數:19,代碼來源:NullAway.java

示例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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:20,代碼來源:JNIWriter.java

示例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++;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:16,代碼來源:T6889255.java

示例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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:VarTypePrinter.java

示例5: isSynthetic

public boolean isSynthetic(Element e) {
    return (((Symbol) e).flags() & Flags.SYNTHETIC) != 0 || (((Symbol) e).flags() & Flags.GENERATEDCONSTR) != 0;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:3,代碼來源:ElementsService.java

示例6: isSynthetic

/**
 * Returns true if this class was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:6,代碼來源:ClassDocImpl.java

示例7: isSynthetic

/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:6,代碼來源:FieldDocImpl.java

示例8: isSynthetic

/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return ((sym.flags() & Flags.SYNTHETIC) != 0);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:6,代碼來源:ExecutableMemberDocImpl.java

示例9: isSynthetic

boolean isSynthetic(Symbol sym) {
    return (sym.flags() & Flags.SYNTHETIC) != 0;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:3,代碼來源:ToolEnvironment.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:ElementUtilities.java


注:本文中的com.sun.tools.javac.code.Flags.SYNTHETIC屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。