Klasse Flags

java.lang.Object
org.aspectj.org.eclipse.jdt.core.Flags

public final class Flags extends Object
Utility class for decoding modifier flags in Java elements.

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

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final int
    Abstract property flag.
    static final int
    Annotation property flag (added in J2SE 1.5).
    static final int
    Annotation method default property flag.
    static final int
    Bridge method property flag (added in J2SE 1.5).
    static final int
    Constant representing the absence of any flag.
    static final int
    Default method property flag.
    static final int
    Deprecated property flag.
    static final int
    Enum property flag (added in J2SE 1.5).
    static final int
    Final access flag.
    static final int
    Interface property flag.
    static final int
    Module declaration property flag.
    static final int
    Native property flag.
    static final int
    Non-sealed property flag.
    static final int
    Private access flag.
    static final int
    Protected access flag.
    static final int
    Public access flag.
    static final int
    Record property flag.
    static final int
    Sealed property flag.
    static final int
    Static access flag.
    static final int
    Strictfp property flag.
    static final int
    Super property flag.
    static final int
    Synchronized access flag.
    static final int
    Synthetic property flag.
    static final int
    Transient property flag.
    static final int
    Varargs method property flag (added in J2SE 1.5).
    static final int
    Volatile property flag.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static boolean
    isAbstract(int flags)
    Returns whether the given integer includes the abstract modifier.
    static boolean
    Returns whether the given integer has the AccAnnnotationDefault bit set.
    static boolean
    isAnnotation(int flags)
    Returns whether the given integer has the AccAnnotation bit set.
    static boolean
    isBridge(int flags)
    Returns whether the given integer has the AccBridge bit set.
    static boolean
    isDefaultMethod(int flags)
    Returns whether the given integer has the AccDefaultMethod bit set.
    static boolean
    isDeprecated(int flags)
    Returns whether the given integer includes the indication that the element is deprecated (@deprecated tag in Javadoc comment).
    static boolean
    isEnum(int flags)
    Returns whether the given integer has the AccEnum bit set.
    static boolean
    isFinal(int flags)
    Returns whether the given integer includes the final modifier.
    static boolean
    isInterface(int flags)
    Returns whether the given integer includes the interface modifier.
    static boolean
    isModule(int flags)
    Returns whether the given integer has the AccModule bit set.
    static boolean
    isNative(int flags)
    Returns whether the given integer includes the native modifier.
    static boolean
    isNonSealed(int flags)
    Returns whether the given integer has the AccNonSealed bit set.
    static boolean
    isPackageDefault(int flags)
    Returns whether the given integer does not include one of the public, private, or protected flags.
    static boolean
    isPrivate(int flags)
    Returns whether the given integer includes the private modifier.
    static boolean
    isProtected(int flags)
    Returns whether the given integer includes the protected modifier.
    static boolean
    isPublic(int flags)
    Returns whether the given integer includes the public modifier.
    static boolean
    isRecord(int flags)
    Returns whether the given integer has the AccRecord bit set.
    static boolean
    isSealed(int flags)
    Returns whether the given integer has the AccSealed bit set.
    static boolean
    isStatic(int flags)
    Returns whether the given integer includes the static modifier.
    static boolean
    isStrictfp(int flags)
    Returns whether the given integer includes the strictfp modifier.
    static boolean
    isSuper(int flags)
    Returns whether the given integer includes the super modifier.
    static boolean
    isSynchronized(int flags)
    Returns whether the given integer includes the synchronized modifier.
    static boolean
    isSynthetic(int flags)
    Returns whether the given integer includes the indication that the element is synthetic.
    static boolean
    isTransient(int flags)
    Returns whether the given integer includes the transient modifier.
    static boolean
    isVarargs(int flags)
    Returns whether the given integer has the AccVarargs bit set.
    static boolean
    isVolatile(int flags)
    Returns whether the given integer includes the volatile modifier.
    static String
    toString(int flags)
    Returns a standard string describing the given modifier flags.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • AccDefault

      public static final int AccDefault
      Constant representing the absence of any flag.
      Seit:
      3.0
      Siehe auch:
    • AccPublic

      public static final int AccPublic
      Public access flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccPrivate

      public static final int AccPrivate
      Private access flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccProtected

      public static final int AccProtected
      Protected access flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccStatic

      public static final int AccStatic
      Static access flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccFinal

      public static final int AccFinal
      Final access flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccSynchronized

      public static final int AccSynchronized
      Synchronized access flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccVolatile

      public static final int AccVolatile
      Volatile property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccTransient

      public static final int AccTransient
      Transient property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccNative

      public static final int AccNative
      Native property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccInterface

      public static final int AccInterface
      Interface property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccAbstract

      public static final int AccAbstract
      Abstract property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccStrictfp

      public static final int AccStrictfp
      Strictfp property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccSuper

      public static final int AccSuper
      Super property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccSynthetic

      public static final int AccSynthetic
      Synthetic property flag. See The Java Virtual Machine Specification for more details.
      Seit:
      2.0
      Siehe auch:
    • AccDeprecated

      public static final int AccDeprecated
      Deprecated 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 AccBridge
      Bridge 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 AccVarargs
      Varargs 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 AccEnum
      Enum 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 AccAnnotation
      Annotation 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 AccDefaultMethod
      Default 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 AccAnnotationDefault
      Annotation 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 AccModule
      Module 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 AccRecord
      Record 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 AccSealed
      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:
    • AccNonSealed

      public static final int AccNonSealed
      Non-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 the abstract modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the abstract modifier is included
    • isDeprecated

      public static boolean isDeprecated(int flags)
      Returns whether the given integer includes the indication that the element is deprecated (@deprecated tag in Javadoc comment).
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the element is marked as deprecated
    • isFinal

      public static boolean isFinal(int flags)
      Returns whether the given integer includes the final modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the final modifier is included
    • isInterface

      public static boolean isInterface(int flags)
      Returns whether the given integer includes the interface modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the interface modifier is included
      Seit:
      2.0
    • isNative

      public static boolean isNative(int flags)
      Returns whether the given integer includes the native modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the native modifier is included
    • isPackageDefault

      public static boolean isPackageDefault(int flags)
      Returns whether the given integer does not include one of the public, private, or protected flags.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if no visibility flag is set
      Seit:
      3.2
    • isPrivate

      public static boolean isPrivate(int flags)
      Returns whether the given integer includes the private modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the private modifier is included
    • isProtected

      public static boolean isProtected(int flags)
      Returns whether the given integer includes the protected modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the protected modifier is included
    • isPublic

      public static boolean isPublic(int flags)
      Returns whether the given integer includes the public modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the public modifier is included
    • isStatic

      public static boolean isStatic(int flags)
      Returns whether the given integer includes the static modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the static modifier is included
    • isSuper

      public static boolean isSuper(int flags)
      Returns whether the given integer includes the super modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the super modifier is included
      Seit:
      3.2
    • isStrictfp

      public static boolean isStrictfp(int flags)
      Returns whether the given integer includes the strictfp modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the strictfp modifier is included
    • isSynchronized

      public static boolean isSynchronized(int flags)
      Returns whether the given integer includes the synchronized modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the synchronized modifier 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:
      true if the element is marked synthetic
    • isTransient

      public static boolean isTransient(int flags)
      Returns whether the given integer includes the transient modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the transient modifier is included
    • isVolatile

      public static boolean isVolatile(int flags)
      Returns whether the given integer includes the volatile modifier.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the volatile modifier is included
    • isBridge

      public static boolean isBridge(int flags)
      Returns whether the given integer has the AccBridge bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccBridge flag is included
      Seit:
      3.0
      Siehe auch:
    • isVarargs

      public static boolean isVarargs(int flags)
      Returns whether the given integer has the AccVarargs bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccVarargs flag is included
      Seit:
      3.0
      Siehe auch:
    • isEnum

      public static boolean isEnum(int flags)
      Returns whether the given integer has the AccEnum bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccEnum flag is included
      Seit:
      3.0
      Siehe auch:
    • isRecord

      public static boolean isRecord(int flags)
      Returns whether the given integer has the AccRecord bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccRecord flag is included
      Seit:
      3.26
      Siehe auch:
    • isSealed

      public static boolean isSealed(int flags)
      Returns whether the given integer has the AccSealed bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccSealed flag is included
      Seit:
      3.28
      Siehe auch:
    • isNonSealed

      public static boolean isNonSealed(int flags)
      Returns whether the given integer has the AccNonSealed bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccNonSealed flag is included
      Seit:
      3.28
      Siehe auch:
    • isAnnotation

      public static boolean isAnnotation(int flags)
      Returns whether the given integer has the AccAnnotation bit set.
      Parameter:
      flags - the flags
      Gibt zurück:
      true if the AccAnnotation flag is included
      Seit:
      3.0
      Siehe auch:
    • isDefaultMethod

      public static boolean isDefaultMethod(int flags)
      Returns whether the given integer has the AccDefaultMethod bit 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:
      true if the AccDefaultMethod flag is included
      Seit:
      3.10
      Siehe auch:
    • isAnnnotationDefault

      public static boolean isAnnnotationDefault(int flags)
      Returns whether the given integer has the AccAnnnotationDefault bit set.
      Gibt zurück:
      true if the AccAnnotationDefault flag is included
      Seit:
      3.10
      Siehe auch:
    • isModule

      public static boolean isModule(int flags)
      Returns whether the given integer has the AccModule bit set.
      Gibt zurück:
      true if the AccModule flag is included
      Seit:
      3.14
      Siehe auch:
    • toString

      public static String toString(int flags)
      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