本文整理匯總了Java中com.sun.tools.javac.code.Flags.ABSTRACT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Flags.ABSTRACT屬性的具體用法?Java Flags.ABSTRACT怎麽用?Java Flags.ABSTRACT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.sun.tools.javac.code.Flags
的用法示例。
在下文中一共展示了Flags.ABSTRACT屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: modifiersToFlags
public static long modifiersToFlags(Set<Modifier> flagset) {
long flags = 0L;
for (Modifier mod : flagset)
switch (mod) {
case PUBLIC: flags |= Flags.PUBLIC; break;
case PROTECTED: flags |= Flags.PROTECTED; break;
case PRIVATE: flags |= Flags.PRIVATE; break;
case ABSTRACT: flags |= Flags.ABSTRACT; break;
case STATIC: flags |= Flags.STATIC; break;
case FINAL: flags |= Flags.FINAL; break;
case TRANSIENT: flags |= Flags.TRANSIENT; break;
case VOLATILE: flags |= Flags.VOLATILE; break;
case SYNCHRONIZED: flags |= Flags.SYNCHRONIZED; break;
case NATIVE: flags |= Flags.NATIVE; break;
case STRICTFP: flags |= Flags.STRICTFP; break;
case DEFAULT: flags |= Flags.DEFAULT; break;
default:
throw new AssertionError("Unknown Modifier: " + mod); //NOI18N
}
return flags;
}
示例2: addModifiersModifier
public ModifiersTree addModifiersModifier(ModifiersTree modifiers, Modifier modifier) {
long c = ((JCModifiers) modifiers).flags & ~Flags.GENERATEDCONSTR;
switch (modifier) {
case ABSTRACT: c = c | Flags.ABSTRACT; break;
case FINAL: c = c | Flags.FINAL; break;
case NATIVE: c = c | Flags.NATIVE; break;
case PRIVATE: c = c | Flags.PRIVATE; break;
case PROTECTED: c = c | Flags.PROTECTED; break;
case PUBLIC: c = c | Flags.PUBLIC; break;
case STATIC: c = c | Flags.STATIC; break;
case STRICTFP: c = c | Flags.STRICTFP; break;
case SYNCHRONIZED: c = c | Flags.SYNCHRONIZED; break;
case TRANSIENT: c = c | Flags.TRANSIENT; break;
case VOLATILE: c = c | Flags.VOLATILE; break;
case DEFAULT: c = c | Flags.DEFAULT; break;
default:
break;
}
return Modifiers(c, modifiers.getAnnotations());
}
示例3: removeModifiersModifier
public ModifiersTree removeModifiersModifier(ModifiersTree modifiers, Modifier modifier) {
long c = ((JCModifiers) modifiers).flags & ~Flags.GENERATEDCONSTR;
switch (modifier) {
case ABSTRACT: c = c & ~Flags.ABSTRACT; break;
case FINAL: c = c & ~Flags.FINAL; break;
case NATIVE: c = c & ~Flags.NATIVE; break;
case PRIVATE: c = c & ~Flags.PRIVATE; break;
case PROTECTED: c = c & ~Flags.PROTECTED; break;
case PUBLIC: c = c & ~Flags.PUBLIC; break;
case STATIC: c = c & ~Flags.STATIC; break;
case STRICTFP: c = c & ~Flags.STRICTFP; break;
case SYNCHRONIZED: c = c & ~Flags.SYNCHRONIZED; break;
case TRANSIENT: c = c & ~Flags.TRANSIENT; break;
case VOLATILE: c = c & ~Flags.VOLATILE; break;
case DEFAULT: c = c & ~Flags.DEFAULT; break;
default:
break;
}
return Modifiers(c, modifiers.getAnnotations());
}
示例4: getFlagByName
long getFlagByName(String modifierName) {
switch (modifierName) {
case "public":
return Flags.PUBLIC;
case "private":
return Flags.PRIVATE;
case "protected":
return Flags.PROTECTED;
case "static":
return Flags.STATIC;
case "final":
return Flags.FINAL;
case "abstract":
return Flags.ABSTRACT;
case "strictfp":
return Flags.STRICTFP;
default:
return 0;
}
}
示例5: getExpectedName
String getExpectedName(VarSymbol v, int i) {
// special cases:
// synthetic method
if (((v.owner.owner.flags() & Flags.ENUM) != 0)
&& v.owner.name.toString().equals("valueOf"))
return "name";
// interfaces don't have saved names
// -- no Code attribute for the LocalVariableTable attribute
if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
return "arg" + (i - 1);
// abstract methods don't have saved names
// -- no Code attribute for the LocalVariableTable attribute
if ((v.owner.flags() & Flags.ABSTRACT) != 0)
return "arg" + (i - 1);
// bridge methods use argN. No LVT for them anymore
if ((v.owner.flags() & Flags.BRIDGE) != 0)
return "arg" + (i - 1);
// The rest of this method assumes the local conventions in the test program
Type t = v.type;
String s;
if (t.hasTag(TypeTag.CLASS))
s = ((ClassType) t).tsym.name.toString();
else
s = t.toString();
return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
示例6: hasImplementation
private static boolean hasImplementation(MethodSymbol msym) {
long f = msym.flags();
return ((f & Flags.DEFAULT) != 0) || ((f & Flags.ABSTRACT) == 0);
}