javassist

Class 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 in javassist.bytecode.AccessFlag.

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

See Also: getModifiers

Field Summary
static intABSTRACT
static intANNOTATION
static intENUM
static intFINAL
static intINTERFACE
static intNATIVE
static intPRIVATE
static intPROTECTED
static intPUBLIC
static intSTATIC
static intSTRICT
static intSYNCHRONIZED
static intTRANSIENT
static intVOLATILE
Method Summary
static intclear(int mod, int clearBit)
Clears a specified bit in mod.
static booleanisAbstract(int mod)
Returns true if the modifiers include the abstract modifier.
static booleanisAnnotation(int mod)
Returns true if the modifiers include the annotation modifier.
static booleanisEnum(int mod)
Returns true if the modifiers include the enum modifier.
static booleanisFinal(int mod)
Returns true if the modifiers include the final modifier.
static booleanisInterface(int mod)
Returns true if the modifiers include the interface modifier.
static booleanisNative(int mod)
Returns true if the modifiers include the native modifier.
static booleanisPackage(int mod)
Returns true if the modifiers do not include either public, protected, or private.
static booleanisPrivate(int mod)
Returns true if the modifiers include the private modifier.
static booleanisProtected(int mod)
Returns true if the modifiers include the protected modifier.
static booleanisPublic(int mod)
Returns true if the modifiers include the public modifier.
static booleanisStatic(int mod)
Returns true if the modifiers include the static modifier.
static booleanisStrict(int mod)
Returns true if the modifiers include the strictfp modifier.
static booleanisSynchronized(int mod)
Returns true if the modifiers include the synchronized modifier.
static booleanisTransient(int mod)
Returns true if the modifiers include the transient modifier.
static booleanisVolatile(int mod)
Returns true if the modifiers include the volatile modifier.
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

ABSTRACT

public static final int ABSTRACT

ANNOTATION

public static final int ANNOTATION

ENUM

public static final int ENUM

FINAL

public static final int FINAL

INTERFACE

public static final int INTERFACE

NATIVE

public static final int NATIVE

PRIVATE

public static final int PRIVATE

PROTECTED

public static final int PROTECTED

PUBLIC

public static final int PUBLIC

STATIC

public static final int STATIC

STRICT

public static final int STRICT

SYNCHRONIZED

public static final int SYNCHRONIZED

TRANSIENT

public static final int TRANSIENT

VOLATILE

public static final int VOLATILE

Method Detail

clear

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

isAbstract

public static boolean isAbstract(int mod)
Returns true if the modifiers include the abstract 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

isFinal

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

isInterface

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

isNative

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

isPackage

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

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.

isPublic

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

isStatic

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

isStrict

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

isSynchronized

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

isTransient

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

isVolatile

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

setPackage

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

setPrivate

public static int setPrivate(int mod)
Truns the private 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.

setPublic

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

toString

public static String toString(int mod)
Return a string describing the access modifier flags in the specified modifier.

Parameters: mod modifier flags.

Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.