Package javassist
Class Modifier
- java.lang.Object
-
- javassist.Modifier
-
public class Modifier extends 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 injavassist.bytecode.AccessFlag.All the methods/constants in this class are compatible with ones in
java.lang.reflect.Modifier.- See Also:
CtClass.getModifiers()
-
-
Field Summary
Fields Modifier and Type Field Description static intABSTRACTstatic intANNOTATIONstatic intENUMstatic intFINALstatic intINTERFACEstatic intNATIVEstatic intPRIVATEstatic intPROTECTEDstatic intPUBLICstatic intSTATICstatic intSTRICTstatic intSYNCHRONIZEDstatic intTRANSIENTstatic intVARARGSstatic intVOLATILE
-
Constructor Summary
Constructors Constructor Description Modifier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intclear(int mod, int clearBit)Clears a specified bit inmod.static booleanisAbstract(int mod)Returns true if the modifiers include theabstractmodifier.static booleanisAnnotation(int mod)Returns true if the modifiers include theannotationmodifier.static booleanisEnum(int mod)Returns true if the modifiers include theenummodifier.static booleanisFinal(int mod)Returns true if the modifiers include thefinalmodifier.static booleanisInterface(int mod)Returns true if the modifiers include theinterfacemodifier.static booleanisNative(int mod)Returns true if the modifiers include thenativemodifier.static booleanisPackage(int mod)Returns true if the modifiers do not include eitherpublic,protected, orprivate.static booleanisPrivate(int mod)Returns true if the modifiers include theprivatemodifier.static booleanisProtected(int mod)Returns true if the modifiers include theprotectedmodifier.static booleanisPublic(int mod)Returns true if the modifiers include thepublicmodifier.static booleanisStatic(int mod)Returns true if the modifiers include thestaticmodifier.static booleanisStrict(int mod)Returns true if the modifiers include thestrictfpmodifier.static booleanisSynchronized(int mod)Returns true if the modifiers include thesynchronizedmodifier.static booleanisTransient(int mod)Returns true if the modifiers include thetransientmodifier.static booleanisVarArgs(int mod)Returns true if the modifiers include thevarargs(variable number of arguments) modifier.static booleanisVolatile(int mod)Returns true if the modifiers include thevolatilemodifier.static intsetPackage(int mod)Clears the public, protected, and private bits.static intsetPrivate(int mod)Truns the private bit on.static intsetProtected(int mod)Truns the protected bit on.static intsetPublic(int mod)Truns the public bit on.static StringtoString(int mod)Return a string describing the access modifier flags in the specified modifier.
-
-
-
Field Detail
-
PUBLIC
public static final int PUBLIC
- See Also:
- Constant Field Values
-
PRIVATE
public static final int PRIVATE
- See Also:
- Constant Field Values
-
PROTECTED
public static final int PROTECTED
- See Also:
- Constant Field Values
-
STATIC
public static final int STATIC
- See Also:
- Constant Field Values
-
FINAL
public static final int FINAL
- See Also:
- Constant Field Values
-
SYNCHRONIZED
public static final int SYNCHRONIZED
- See Also:
- Constant Field Values
-
VOLATILE
public static final int VOLATILE
- See Also:
- Constant Field Values
-
VARARGS
public static final int VARARGS
- See Also:
- Constant Field Values
-
TRANSIENT
public static final int TRANSIENT
- See Also:
- Constant Field Values
-
NATIVE
public static final int NATIVE
- See Also:
- Constant Field Values
-
INTERFACE
public static final int INTERFACE
- See Also:
- Constant Field Values
-
ABSTRACT
public static final int ABSTRACT
- See Also:
- Constant Field Values
-
STRICT
public static final int STRICT
- See Also:
- Constant Field Values
-
ANNOTATION
public static final int ANNOTATION
- See Also:
- Constant Field Values
-
ENUM
public static final int ENUM
- See Also:
- Constant Field Values
-
-
Method Detail
-
isPublic
public static boolean isPublic(int mod)
Returns true if the modifiers include thepublicmodifier.
-
isPrivate
public static boolean isPrivate(int mod)
Returns true if the modifiers include theprivatemodifier.
-
isProtected
public static boolean isProtected(int mod)
Returns true if the modifiers include theprotectedmodifier.
-
isPackage
public static boolean isPackage(int mod)
Returns true if the modifiers do not include eitherpublic,protected, orprivate.
-
isStatic
public static boolean isStatic(int mod)
Returns true if the modifiers include thestaticmodifier.
-
isFinal
public static boolean isFinal(int mod)
Returns true if the modifiers include thefinalmodifier.
-
isSynchronized
public static boolean isSynchronized(int mod)
Returns true if the modifiers include thesynchronizedmodifier.
-
isVolatile
public static boolean isVolatile(int mod)
Returns true if the modifiers include thevolatilemodifier.
-
isTransient
public static boolean isTransient(int mod)
Returns true if the modifiers include thetransientmodifier.
-
isNative
public static boolean isNative(int mod)
Returns true if the modifiers include thenativemodifier.
-
isInterface
public static boolean isInterface(int mod)
Returns true if the modifiers include theinterfacemodifier.
-
isAnnotation
public static boolean isAnnotation(int mod)
Returns true if the modifiers include theannotationmodifier.- Since:
- 3.2
-
isEnum
public static boolean isEnum(int mod)
Returns true if the modifiers include theenummodifier.- Since:
- 3.2
-
isAbstract
public static boolean isAbstract(int mod)
Returns true if the modifiers include theabstractmodifier.
-
isStrict
public static boolean isStrict(int mod)
Returns true if the modifiers include thestrictfpmodifier.
-
isVarArgs
public static boolean isVarArgs(int mod)
Returns true if the modifiers include thevarargs(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 inmod.
-
toString
public static String toString(int mod)
Return a string describing the access modifier flags in the specified modifier.- Parameters:
mod- modifier flags.
-
-