Klasse Flags
This class provides static methods only.
Note that the numeric values of these flags match the ones for class files
as described in the Java Virtual Machine Specification (except for
AccDeprecated, AccAnnotationDefault, and AccDefaultMethod).
The AST class Modifier provides
similar functionality as this class, only in the
org.aspectj.org.eclipse.jdt.core.dom package.
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final intAbstract property flag.static final intAnnotation property flag (added in J2SE 1.5).static final intAnnotation method default property flag.static final intBridge method property flag (added in J2SE 1.5).static final intConstant representing the absence of any flag.static final intDefault method property flag.static final intDeprecated property flag.static final intEnum property flag (added in J2SE 1.5).static final intFinal access flag.static final intInterface property flag.static final intModule declaration property flag.static final intNative property flag.static final intNon-sealed property flag.static final intPrivate access flag.static final intProtected access flag.static final intPublic access flag.static final intRecord property flag.static final intSealed property flag.static final intStatic access flag.static final intStrictfp property flag.static final intSuper property flag.static final intSynchronized access flag.static final intSynthetic property flag.static final intTransient property flag.static final intVarargs method property flag (added in J2SE 1.5).static final intVolatile property flag. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic booleanisAbstract(int flags) Returns whether the given integer includes theabstractmodifier.static booleanisAnnnotationDefault(int flags) Returns whether the given integer has theAccAnnnotationDefaultbit set.static booleanisAnnotation(int flags) Returns whether the given integer has theAccAnnotationbit set.static booleanisBridge(int flags) Returns whether the given integer has theAccBridgebit set.static booleanisDefaultMethod(int flags) Returns whether the given integer has theAccDefaultMethodbit set.static booleanisDeprecated(int flags) Returns whether the given integer includes the indication that the element is deprecated (@deprecatedtag in Javadoc comment).static booleanisEnum(int flags) Returns whether the given integer has theAccEnumbit set.static booleanisFinal(int flags) Returns whether the given integer includes thefinalmodifier.static booleanisInterface(int flags) Returns whether the given integer includes theinterfacemodifier.static booleanisModule(int flags) Returns whether the given integer has theAccModulebit set.static booleanisNative(int flags) Returns whether the given integer includes thenativemodifier.static booleanisNonSealed(int flags) Returns whether the given integer has theAccNonSealedbit set.static booleanisPackageDefault(int flags) Returns whether the given integer does not include one of thepublic,private, orprotectedflags.static booleanisPrivate(int flags) Returns whether the given integer includes theprivatemodifier.static booleanisProtected(int flags) Returns whether the given integer includes theprotectedmodifier.static booleanisPublic(int flags) Returns whether the given integer includes thepublicmodifier.static booleanisRecord(int flags) Returns whether the given integer has theAccRecordbit set.static booleanisSealed(int flags) Returns whether the given integer has theAccSealedbit set.static booleanisStatic(int flags) Returns whether the given integer includes thestaticmodifier.static booleanisStrictfp(int flags) Returns whether the given integer includes thestrictfpmodifier.static booleanisSuper(int flags) Returns whether the given integer includes thesupermodifier.static booleanisSynchronized(int flags) Returns whether the given integer includes thesynchronizedmodifier.static booleanisSynthetic(int flags) Returns whether the given integer includes the indication that the element is synthetic.static booleanisTransient(int flags) Returns whether the given integer includes thetransientmodifier.static booleanisVarargs(int flags) Returns whether the given integer has theAccVarargsbit set.static booleanisVolatile(int flags) Returns whether the given integer includes thevolatilemodifier.static StringtoString(int flags) Returns a standard string describing the given modifier flags.
-
Felddetails
-
AccDefault
public static final int AccDefaultConstant representing the absence of any flag.- Seit:
- 3.0
- Siehe auch:
-
AccPublic
public static final int AccPublicPublic access flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccPrivate
public static final int AccPrivatePrivate access flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccProtected
public static final int AccProtectedProtected access flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccStatic
public static final int AccStaticStatic access flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccFinal
public static final int AccFinalFinal access flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccSynchronized
public static final int AccSynchronizedSynchronized access flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccVolatile
public static final int AccVolatileVolatile property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccTransient
public static final int AccTransientTransient property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccNative
public static final int AccNativeNative property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccInterface
public static final int AccInterfaceInterface property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccAbstract
public static final int AccAbstractAbstract property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccStrictfp
public static final int AccStrictfpStrictfp property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccSuper
public static final int AccSuperSuper property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccSynthetic
public static final int AccSyntheticSynthetic property flag. See The Java Virtual Machine Specification for more details.- Seit:
- 2.0
- Siehe auch:
-
AccDeprecated
public static final int AccDeprecatedDeprecated property flag.Note that this flag's value is internal and is not defined in the Virtual Machine specification.
- Seit:
- 2.0
- Siehe auch:
-
AccBridge
public static final int AccBridgeBridge method property flag (added in J2SE 1.5). Used to flag a compiler-generated bridge methods. See The Java Virtual Machine Specification for more details.- Seit:
- 3.0
- Siehe auch:
-
AccVarargs
public static final int AccVarargsVarargs method property flag (added in J2SE 1.5). Used to flag variable arity method declarations. See The Java Virtual Machine Specification for more details.- Seit:
- 3.0
- Siehe auch:
-
AccEnum
public static final int AccEnumEnum property flag (added in J2SE 1.5). See The Java Virtual Machine Specification for more details.- Seit:
- 3.0
- Siehe auch:
-
AccAnnotation
public static final int AccAnnotationAnnotation property flag (added in J2SE 1.5). See The Java Virtual Machine Specification for more details.- Seit:
- 3.0
- Siehe auch:
-
AccDefaultMethod
public static final int AccDefaultMethodDefault method property flag.Note that this flag's value is internal and is not defined in the Virtual Machine specification.
- Seit:
- 3.10
- Siehe auch:
-
AccAnnotationDefault
public static final int AccAnnotationDefaultAnnotation method default property flag. Used to flag annotation type methods that declare a default value.Note that this flag's value is internal and is not defined in the Virtual Machine specification.
- Seit:
- 3.10
- Siehe auch:
-
AccModule
public static final int AccModuleModule declaration property flag. Used to flag a compilation unit or a class file that contains a module declaration.- Seit:
- 3.14
- Siehe auch:
-
AccRecord
public static final int AccRecordRecord property flag.Note that this flag's value is internal and is not defined in the Virtual Machine specification.
- Seit:
- 3.26
- Siehe auch:
-
AccSealed
public static final int AccSealedSealed property flag.Note that this flag's value is internal and is not defined in the Virtual Machine specification.
- Seit:
- 3.24
- Siehe auch:
-
AccNonSealed
public static final int AccNonSealedNon-sealed property flag.Note that this flag's value is internal and is not defined in the Virtual Machine specification.
- Seit:
- 3.24
- Siehe auch:
-
-
Methodendetails
-
isAbstract
public static boolean isAbstract(int flags) Returns whether the given integer includes theabstractmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif theabstractmodifier is included
-
isDeprecated
public static boolean isDeprecated(int flags) Returns whether the given integer includes the indication that the element is deprecated (@deprecatedtag in Javadoc comment).- Parameter:
flags- the flags- Gibt zurück:
trueif the element is marked as deprecated
-
isFinal
public static boolean isFinal(int flags) Returns whether the given integer includes thefinalmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thefinalmodifier is included
-
isInterface
public static boolean isInterface(int flags) Returns whether the given integer includes theinterfacemodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif theinterfacemodifier is included- Seit:
- 2.0
-
isNative
public static boolean isNative(int flags) Returns whether the given integer includes thenativemodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thenativemodifier is included
-
isPackageDefault
public static boolean isPackageDefault(int flags) Returns whether the given integer does not include one of thepublic,private, orprotectedflags.- Parameter:
flags- the flags- Gibt zurück:
trueif no visibility flag is set- Seit:
- 3.2
-
isPrivate
public static boolean isPrivate(int flags) Returns whether the given integer includes theprivatemodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif theprivatemodifier is included
-
isProtected
public static boolean isProtected(int flags) Returns whether the given integer includes theprotectedmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif theprotectedmodifier is included
-
isPublic
public static boolean isPublic(int flags) Returns whether the given integer includes thepublicmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thepublicmodifier is included
-
isStatic
public static boolean isStatic(int flags) Returns whether the given integer includes thestaticmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thestaticmodifier is included
-
isSuper
public static boolean isSuper(int flags) Returns whether the given integer includes thesupermodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thesupermodifier is included- Seit:
- 3.2
-
isStrictfp
public static boolean isStrictfp(int flags) Returns whether the given integer includes thestrictfpmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thestrictfpmodifier is included
-
isSynchronized
public static boolean isSynchronized(int flags) Returns whether the given integer includes thesynchronizedmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thesynchronizedmodifier is included
-
isSynthetic
public static boolean isSynthetic(int flags) Returns whether the given integer includes the indication that the element is synthetic.- Parameter:
flags- the flags- Gibt zurück:
trueif the element is marked synthetic
-
isTransient
public static boolean isTransient(int flags) Returns whether the given integer includes thetransientmodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thetransientmodifier is included
-
isVolatile
public static boolean isVolatile(int flags) Returns whether the given integer includes thevolatilemodifier.- Parameter:
flags- the flags- Gibt zurück:
trueif thevolatilemodifier is included
-
isBridge
public static boolean isBridge(int flags) Returns whether the given integer has theAccBridgebit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccBridgeflag is included- Seit:
- 3.0
- Siehe auch:
-
isVarargs
public static boolean isVarargs(int flags) Returns whether the given integer has theAccVarargsbit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccVarargsflag is included- Seit:
- 3.0
- Siehe auch:
-
isEnum
public static boolean isEnum(int flags) Returns whether the given integer has theAccEnumbit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccEnumflag is included- Seit:
- 3.0
- Siehe auch:
-
isRecord
public static boolean isRecord(int flags) Returns whether the given integer has theAccRecordbit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccRecordflag is included- Seit:
- 3.26
- Siehe auch:
-
isSealed
public static boolean isSealed(int flags) Returns whether the given integer has theAccSealedbit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccSealedflag is included- Seit:
- 3.28
- Siehe auch:
-
isNonSealed
public static boolean isNonSealed(int flags) Returns whether the given integer has theAccNonSealedbit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccNonSealedflag is included- Seit:
- 3.28
- Siehe auch:
-
isAnnotation
public static boolean isAnnotation(int flags) Returns whether the given integer has theAccAnnotationbit set.- Parameter:
flags- the flags- Gibt zurück:
trueif theAccAnnotationflag is included- Seit:
- 3.0
- Siehe auch:
-
isDefaultMethod
public static boolean isDefaultMethod(int flags) Returns whether the given integer has theAccDefaultMethodbit set. Note that this flag represents the usage of the 'default' keyword on a method and should not be confused with the 'package' access visibility (which used to be called 'default access').- Gibt zurück:
trueif theAccDefaultMethodflag is included- Seit:
- 3.10
- Siehe auch:
-
isAnnnotationDefault
public static boolean isAnnnotationDefault(int flags) Returns whether the given integer has theAccAnnnotationDefaultbit set.- Gibt zurück:
trueif theAccAnnotationDefaultflag is included- Seit:
- 3.10
- Siehe auch:
-
isModule
public static boolean isModule(int flags) Returns whether the given integer has theAccModulebit set.- Gibt zurück:
trueif theAccModuleflag is included- Seit:
- 3.14
- Siehe auch:
-
toString
Returns a standard string describing the given modifier flags. Only modifier flags are included in the output; deprecated, synthetic, bridge, etc. flags are ignored.The flags are output in the following order:
public protected private abstract default static final synchronized native strictfp transient volatile
This order is consistent with the recommendations in JLS8 ("*Modifier:" rules in chapters 8 and 9).
Note that the flags of a method can include the AccVarargs flag that has no standard description. Since the AccVarargs flag has the same value as the AccTransient flag (valid for fields only), attempting to get the description of method modifiers with the AccVarargs flag set would result in an unexpected description. Clients should ensure that the AccVarargs is not included in the flags of a method as follows:
IMethod method = ... int flags = method.getFlags() Ungültige Eingabe: "&" ~Flags.AccVarargs; return Flags.toString(flags);Examples results:
"public static final""private native"- Parameter:
flags- the flags- Gibt zurück:
- the standard string representation of the given flags
-