Package javassist

Class Modifier


  • public class Modifier
    extends java.lang.Object
    The Modifier class provides static methods and constants to decode class and member access modifiers. The constant values are equivalent to the corresponding values in javassist.bytecode.AccessFlag.

    All the methods/constants in this class are compatible with ones in java.lang.reflect.Modifier.

    See Also:
    CtClass.getModifiers()
    • Constructor Summary

      Constructors 
      Constructor Description
      Modifier()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int clear​(int mod, int clearBit)
      Clears a specified bit in mod.
      static boolean isAbstract​(int mod)
      Returns true if the modifiers include the abstract modifier.
      static boolean isAnnotation​(int mod)
      Returns true if the modifiers include the annotation modifier.
      static boolean isEnum​(int mod)
      Returns true if the modifiers include the enum modifier.
      static boolean isFinal​(int mod)
      Returns true if the modifiers include the final modifier.
      static boolean isInterface​(int mod)
      Returns true if the modifiers include the interface modifier.
      static boolean isNative​(int mod)
      Returns true if the modifiers include the native modifier.
      static boolean isPackage​(int mod)
      Returns true if the modifiers do not include either public, protected, or private.
      static boolean isPrivate​(int mod)
      Returns true if the modifiers include the private modifier.
      static boolean isProtected​(int mod)
      Returns true if the modifiers include the protected modifier.
      static boolean isPublic​(int mod)
      Returns true if the modifiers include the public modifier.
      static boolean isStatic​(int mod)
      Returns true if the modifiers include the static modifier.
      static boolean isStrict​(int mod)
      Returns true if the modifiers include the strictfp modifier.
      static boolean isSynchronized​(int mod)
      Returns true if the modifiers include the synchronized modifier.
      static boolean isTransient​(int mod)
      Returns true if the modifiers include the transient modifier.
      static boolean isVarArgs​(int mod)
      Returns true if the modifiers include the varargs (variable number of arguments) modifier.
      static boolean isVolatile​(int mod)
      Returns true if the modifiers include the volatile modifier.
      static int setPackage​(int mod)
      Clears the public, protected, and private bits.
      static int setPrivate​(int mod)
      Truns the private bit on.
      static int setProtected​(int mod)
      Truns the protected bit on.
      static int setPublic​(int mod)
      Truns the public bit on.
      static java.lang.String toString​(int mod)
      Return a string describing the access modifier flags in the specified modifier.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Modifier

        public Modifier()
    • Method Detail

      • isPublic

        public static boolean isPublic​(int mod)
        Returns true if the modifiers include the public modifier.
      • isPrivate

        public static boolean isPrivate​(int mod)
        Returns true if the modifiers include the private modifier.
      • isProtected

        public static boolean isProtected​(int mod)
        Returns true if the modifiers include the protected modifier.
      • isPackage

        public static boolean isPackage​(int mod)
        Returns true if the modifiers do not include either public, protected, or private.
      • isStatic

        public static boolean isStatic​(int mod)
        Returns true if the modifiers include the static modifier.
      • isFinal

        public static boolean isFinal​(int mod)
        Returns true if the modifiers include the final modifier.
      • isSynchronized

        public static boolean isSynchronized​(int mod)
        Returns true if the modifiers include the synchronized modifier.
      • isVolatile

        public static boolean isVolatile​(int mod)
        Returns true if the modifiers include the volatile modifier.
      • isTransient

        public static boolean isTransient​(int mod)
        Returns true if the modifiers include the transient modifier.
      • isNative

        public static boolean isNative​(int mod)
        Returns true if the modifiers include the native modifier.
      • isInterface

        public static boolean isInterface​(int mod)
        Returns true if the modifiers include the interface modifier.
      • isAnnotation

        public static boolean isAnnotation​(int mod)
        Returns true if the modifiers include the annotation modifier.
        Since:
        3.2
      • isEnum

        public static boolean isEnum​(int mod)
        Returns true if the modifiers include the enum modifier.
        Since:
        3.2
      • isAbstract

        public static boolean isAbstract​(int mod)
        Returns true if the modifiers include the abstract modifier.
      • isStrict

        public static boolean isStrict​(int mod)
        Returns true if the modifiers include the strictfp modifier.
      • isVarArgs

        public static boolean isVarArgs​(int mod)
        Returns true if the modifiers include the varargs (variable number of arguments) modifier.
      • setPublic

        public static int setPublic​(int mod)
        Truns the public bit on. The protected and private bits are cleared.
      • setProtected

        public static int setProtected​(int mod)
        Truns the protected bit on. The protected and public bits are cleared.
      • setPrivate

        public static int setPrivate​(int mod)
        Truns the private bit on. The protected and private bits are cleared.
      • setPackage

        public static int setPackage​(int mod)
        Clears the public, protected, and private bits.
      • clear

        public static int clear​(int mod,
                                int clearBit)
        Clears a specified bit in mod.
      • toString

        public static java.lang.String toString​(int mod)
        Return a string describing the access modifier flags in the specified modifier.
        Parameters:
        mod - modifier flags.