public class Modifiers
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
CLASS |
static java.util.Map<java.lang.String,java.lang.Integer> |
CONST |
static int |
CONSTRUCTOR |
static int |
FIELD |
static int |
INTERFACE |
static int |
METHOD |
static int |
PARAMETER |
| Constructor and Description |
|---|
Modifiers(int context)
Default constructor specifying the context these modifiers apply to.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addModifier(int mod)
Add modifier by unique identifier number.
|
void |
addModifier(java.lang.String name)
Add a modifier by modifier name.
|
void |
addModifiers(int mods)
Add multiple modifiers defined by a destinct bit definition.
|
void |
changeContext(int context)
Change the current applied context and revalidate the modifiers.
|
int |
getModifiers()
Retrieve the distinct bit definition of all applied modifiers.
|
boolean |
hasModifier(int mod)
Query whether the modifier has been applied.
|
boolean |
hasModifier(java.lang.String name)
Query whether the modifier has been applied.
|
boolean |
isAppliedContext(int context)
Verify whether the expected application context is configured.
|
void |
setConstant()
Convenience method to assign modifiers for a constant definition.
|
java.lang.String |
toString() |
public static final int CLASS
public static final int INTERFACE
public static final int METHOD
public static final int FIELD
public static final int PARAMETER
public static final int CONSTRUCTOR
public static final java.util.Map<java.lang.String,java.lang.Integer> CONST
public Modifiers(int context)
context - identifier for the application of modifierspublic void addModifier(java.lang.String name)
name - the string name of the modifier to add.public void addModifier(int mod)
mod - unique bit definition for a modifier to applypublic void addModifiers(int mods)
mods - distinct bit definition of modifiers to applypublic int getModifiers()
public void changeContext(int context)
context - identifier for the application of modifierspublic boolean isAppliedContext(int context)
context - the query to verifypublic boolean hasModifier(java.lang.String name)
name - modifier name for lookuppublic boolean hasModifier(int mod)
mod - unique modifier bit value for lookuppublic void setConstant()
public java.lang.String toString()
toString in class java.lang.Object