Package org.apache.bcel.classfile
Class AccessFlags
- java.lang.Object
-
- org.apache.bcel.classfile.AccessFlags
-
- Direct Known Subclasses:
ClassGen
,FieldGenOrMethodGen
,FieldOrMethod
,JavaClass
public abstract class AccessFlags extends java.lang.Object
Super class for all objects that have modifiers like private, final, ... I.e. classes, fields, and methods.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
access_flags
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter.
-
Constructor Summary
Constructors Constructor Description AccessFlags()
Constructs a new instance.AccessFlags(int accessFlags)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAccessFlags()
Gets access flags.int
getModifiers()
Gets access flags.boolean
isAbstract()
Tests whether the abstract bit is on.void
isAbstract(boolean flag)
Sets the abstract bit.boolean
isAnnotation()
Tests whether the annotation bit is on.void
isAnnotation(boolean flag)
Sets the annotation bit.boolean
isEnum()
Tests whether the enum bit is on.void
isEnum(boolean flag)
Sets the enum bit.boolean
isFinal()
Tests whether the final bit is on.void
isFinal(boolean flag)
Sets the final bit.boolean
isInterface()
Tests whether the interface bit is on.void
isInterface(boolean flag)
Sets the interface bit.boolean
isNative()
Tests whether the native bit is on.void
isNative(boolean flag)
Sets the native bit.boolean
isPrivate()
Tests whether the private bit is on.void
isPrivate(boolean flag)
Sets the private bit.boolean
isProtected()
Tests whether the protected bit is on.void
isProtected(boolean flag)
Sets the protected bit.boolean
isPublic()
Tests whether the public bit is on.void
isPublic(boolean flag)
Sets the public bit.boolean
isStatic()
Tests whether the static bit is on.void
isStatic(boolean flag)
Sets the static bit.boolean
isStrictfp()
Tests whether the strict bit is on.void
isStrictfp(boolean flag)
Sets the strict bit.boolean
isSynchronized()
Tests whether the synchronized bit is on.void
isSynchronized(boolean flag)
Sets the synchronized bit.boolean
isSynthetic()
Tests whether the synthetic bit is on.void
isSynthetic(boolean flag)
Sets the synthetic bit.boolean
isTransient()
Tests whether the transient bit is on.void
isTransient(boolean flag)
Sets the varargs bit.boolean
isVarArgs()
Tests whether the varargs bit is on.void
isVarArgs(boolean flag)
Sets the varargs bit.boolean
isVolatile()
Tests whether the volatile bit is on.void
isVolatile(boolean flag)
Sets the volatile bit.void
setAccessFlags(int accessFlags)
Sets access flags also known as modifiers.void
setModifiers(int accessFlags)
Sets access flags aka "modifiers".
-
-
-
Field Detail
-
access_flags
@Deprecated protected int access_flags
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter.Access flags.
-
-
Constructor Detail
-
AccessFlags
public AccessFlags()
Constructs a new instance.
-
AccessFlags
public AccessFlags(int accessFlags)
Constructs a new instance.- Parameters:
accessFlags
- initial access flags.
-
-
Method Detail
-
getAccessFlags
public final int getAccessFlags()
Gets access flags.- Returns:
- Access flags of the object aka. "modifiers".
-
getModifiers
public final int getModifiers()
Gets access flags.- Returns:
- Access flags of the object also known as modifiers.
-
isAbstract
public final boolean isAbstract()
Tests whether the abstract bit is on.- Returns:
- whether the abstract bit is on.
-
isAbstract
public final void isAbstract(boolean flag)
Sets the abstract bit.- Parameters:
flag
- The new value.
-
isAnnotation
public final boolean isAnnotation()
Tests whether the annotation bit is on.- Returns:
- whether the annotation bit is on.
-
isAnnotation
public final void isAnnotation(boolean flag)
Sets the annotation bit.- Parameters:
flag
- The new value.
-
isEnum
public final boolean isEnum()
Tests whether the enum bit is on.- Returns:
- whether the enum bit is on.
-
isEnum
public final void isEnum(boolean flag)
Sets the enum bit.- Parameters:
flag
- The new value.
-
isFinal
public final boolean isFinal()
Tests whether the final bit is on.- Returns:
- whether the final bit is on.
-
isFinal
public final void isFinal(boolean flag)
Sets the final bit.- Parameters:
flag
- The new value.
-
isInterface
public final boolean isInterface()
Tests whether the interface bit is on.- Returns:
- whether the interface bit is on.
-
isInterface
public final void isInterface(boolean flag)
Sets the interface bit.- Parameters:
flag
- The new value.
-
isNative
public final boolean isNative()
Tests whether the native bit is on.- Returns:
- whether the native bit is on.
-
isNative
public final void isNative(boolean flag)
Sets the native bit.- Parameters:
flag
- The new value.
-
isPrivate
public final boolean isPrivate()
Tests whether the private bit is on.- Returns:
- whether the private bit is on.
-
isPrivate
public final void isPrivate(boolean flag)
Sets the private bit.- Parameters:
flag
- The new value.
-
isProtected
public final boolean isProtected()
Tests whether the protected bit is on.- Returns:
- whether the protected bit is on.
-
isProtected
public final void isProtected(boolean flag)
Sets the protected bit.- Parameters:
flag
- The new value.
-
isPublic
public final boolean isPublic()
Tests whether the public bit is on.- Returns:
- whether the public bit is on.
-
isPublic
public final void isPublic(boolean flag)
Sets the public bit.- Parameters:
flag
- The new value.
-
isStatic
public final boolean isStatic()
Tests whether the static bit is on.- Returns:
- whether the static bit is on.
-
isStatic
public final void isStatic(boolean flag)
Sets the static bit.- Parameters:
flag
- The new value.
-
isStrictfp
public final boolean isStrictfp()
Tests whether the strict bit is on.- Returns:
- whether the strict bit is on.
-
isStrictfp
public final void isStrictfp(boolean flag)
Sets the strict bit.- Parameters:
flag
- The new value.
-
isSynchronized
public final boolean isSynchronized()
Tests whether the synchronized bit is on.- Returns:
- whether the synchronized bit is on.
-
isSynchronized
public final void isSynchronized(boolean flag)
Sets the synchronized bit.- Parameters:
flag
- The new value.
-
isSynthetic
public final boolean isSynthetic()
Tests whether the synthetic bit is on.- Returns:
- whether the synthetic bit is on.
-
isSynthetic
public final void isSynthetic(boolean flag)
Sets the synthetic bit.- Parameters:
flag
- The new value.
-
isTransient
public final boolean isTransient()
Tests whether the transient bit is on.- Returns:
- whether the varargs bit is on.
-
isTransient
public final void isTransient(boolean flag)
Sets the varargs bit.- Parameters:
flag
- The new value.
-
isVarArgs
public final boolean isVarArgs()
Tests whether the varargs bit is on.- Returns:
- whether the varargs bit is on.
-
isVarArgs
public final void isVarArgs(boolean flag)
Sets the varargs bit.- Parameters:
flag
- The new value.
-
isVolatile
public final boolean isVolatile()
Tests whether the volatile bit is on.- Returns:
- whether the volatile bit is on.
-
isVolatile
public final void isVolatile(boolean flag)
Sets the volatile bit.- Parameters:
flag
- The new value.
-
setAccessFlags
public final void setAccessFlags(int accessFlags)
Sets access flags also known as modifiers.- Parameters:
accessFlags
- Access flags of the object.
-
setModifiers
public final void setModifiers(int accessFlags)
Sets access flags aka "modifiers".- Parameters:
accessFlags
- Access flags of the object.
-
-