Package javassist
Class Modifier
java.lang.Object
javassist.Modifier
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:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
clear
(int mod, int clearBit) Clears a specified bit inmod
.static boolean
isAbstract
(int mod) Returns true if the modifiers include theabstract
modifier.static boolean
isAnnotation
(int mod) Returns true if the modifiers include theannotation
modifier.static boolean
isEnum
(int mod) Returns true if the modifiers include theenum
modifier.static boolean
isFinal
(int mod) Returns true if the modifiers include thefinal
modifier.static boolean
isInterface
(int mod) Returns true if the modifiers include theinterface
modifier.static boolean
isNative
(int mod) Returns true if the modifiers include thenative
modifier.static boolean
isPackage
(int mod) Returns true if the modifiers do not include eitherpublic
,protected
, orprivate
.static boolean
isPrivate
(int mod) Returns true if the modifiers include theprivate
modifier.static boolean
isProtected
(int mod) Returns true if the modifiers include theprotected
modifier.static boolean
isPublic
(int mod) Returns true if the modifiers include thepublic
modifier.static boolean
isStatic
(int mod) Returns true if the modifiers include thestatic
modifier.static boolean
isStrict
(int mod) Returns true if the modifiers include thestrictfp
modifier.static boolean
isSynchronized
(int mod) Returns true if the modifiers include thesynchronized
modifier.static boolean
isTransient
(int mod) Returns true if the modifiers include thetransient
modifier.static boolean
isVarArgs
(int mod) Returns true if the modifiers include thevarargs
(variable number of arguments) modifier.static boolean
isVolatile
(int mod) Returns true if the modifiers include thevolatile
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 String
toString
(int mod) Return a string describing the access modifier flags in the specified modifier.
-
Field Details
-
PUBLIC
public static final int PUBLIC- See Also:
-
PRIVATE
public static final int PRIVATE- See Also:
-
PROTECTED
public static final int PROTECTED- See Also:
-
STATIC
public static final int STATIC- See Also:
-
FINAL
public static final int FINAL- See Also:
-
SYNCHRONIZED
public static final int SYNCHRONIZED- See Also:
-
VOLATILE
public static final int VOLATILE- See Also:
-
VARARGS
public static final int VARARGS- See Also:
-
TRANSIENT
public static final int TRANSIENT- See Also:
-
NATIVE
public static final int NATIVE- See Also:
-
INTERFACE
public static final int INTERFACE- See Also:
-
ABSTRACT
public static final int ABSTRACT- See Also:
-
STRICT
public static final int STRICT- See Also:
-
ANNOTATION
public static final int ANNOTATION- See Also:
-
ENUM
public static final int ENUM- See Also:
-
-
Constructor Details
-
Modifier
public Modifier()
-
-
Method Details
-
isPublic
public static boolean isPublic(int mod) Returns true if the modifiers include thepublic
modifier. -
isPrivate
public static boolean isPrivate(int mod) Returns true if the modifiers include theprivate
modifier. -
isProtected
public static boolean isProtected(int mod) Returns true if the modifiers include theprotected
modifier. -
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 thestatic
modifier. -
isFinal
public static boolean isFinal(int mod) Returns true if the modifiers include thefinal
modifier. -
isSynchronized
public static boolean isSynchronized(int mod) Returns true if the modifiers include thesynchronized
modifier. -
isVolatile
public static boolean isVolatile(int mod) Returns true if the modifiers include thevolatile
modifier. -
isTransient
public static boolean isTransient(int mod) Returns true if the modifiers include thetransient
modifier. -
isNative
public static boolean isNative(int mod) Returns true if the modifiers include thenative
modifier. -
isInterface
public static boolean isInterface(int mod) Returns true if the modifiers include theinterface
modifier. -
isAnnotation
public static boolean isAnnotation(int mod) Returns true if the modifiers include theannotation
modifier.- Since:
- 3.2
-
isEnum
public static boolean isEnum(int mod) Returns true if the modifiers include theenum
modifier.- Since:
- 3.2
-
isAbstract
public static boolean isAbstract(int mod) Returns true if the modifiers include theabstract
modifier. -
isStrict
public static boolean isStrict(int mod) Returns true if the modifiers include thestrictfp
modifier. -
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
Return a string describing the access modifier flags in the specified modifier.- Parameters:
mod
- modifier flags.
-