public class Modifiers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VIS_DEFAULT
String constant for "".
|
static java.lang.String |
VIS_PRIVATE
String constant for "private".
|
static java.lang.String |
VIS_PROTECTED
String constant for "protected".
|
static java.lang.String |
VIS_PUBLIC
String constant for "public".
|
Constructor and Description |
---|
Modifiers()
Initialize the new instance with default value 0.
|
Modifiers(int initialValue)
Initialize the new instance with given value.
|
Modifier and Type | Method and Description |
---|---|
static Modifiers |
create()
Returns a new unintialized instance.
|
static Modifiers |
create(java.lang.reflect.Field field)
Returns a new instance initialized with the modifier bits of the given field.
|
static Modifiers |
create(int initialValue)
Returns a new instance initialized with the given bit settings.
|
boolean |
equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one.
|
int |
getBits()
Return the bits as they are currently set.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isAbstract()
Return true if the modifiers includes the abstract modifier,
false otherwise.
|
boolean |
isDefaultVisibility()
Return true if the modifier bits does not include any of the
visibility modifiers public, protected private,
false otherwise.
|
boolean |
isFinal()
Return true if the modifiers includes the final modifier,
false otherwise.
|
boolean |
isInterface()
Return true if the modifiers includes the interface modifier,
false otherwise.
|
boolean |
isNative()
Return true if the modifiers includes the native modifier,
false otherwise.
|
boolean |
isPrivate()
Return true if the modifiers includes the private modifier,
false otherwise.
|
boolean |
isProtected()
Return true if the modifiers includes the protected modifier,
false otherwise.
|
boolean |
isPublic()
Return true if the modifiers includes the public modifier,
false otherwise.
|
boolean |
isStatic()
Return true if the modifiers includes the static modifier,
false otherwise.
|
boolean |
isStrict()
Return true if the modifiers includes the strict modifier,
false otherwise.
|
boolean |
isSynchronized()
Return true if the modifiers includes the synchronized modifier,
false otherwise.
|
boolean |
isTransient()
Return true if the modifiers includes the transient modifier,
false otherwise.
|
boolean |
isVolatile()
Return true if the modifiers includes the volatile modifier,
false otherwise.
|
static Modifiers |
of(java.lang.Class<?> type)
Returns a new instance initialized with the modifier bits of the given class.
|
static Modifiers |
of(java.lang.reflect.Member member)
Returns a new instance initialized with the modifier bits of the given
member (i.e.
|
Modifiers |
reset()
Resets the modifier to 0.
|
Modifiers |
setAbstract()
Sets the ABSTRACT bit.
|
protected void |
setBits(int newValue) |
Modifiers |
setDefaultVisibility()
Sets the visibility to default that means unset
PUBLIC, PROTECTED, PRIVATE bits.
|
Modifiers |
setFinal()
Sets the FINAL bit.
|
Modifiers |
setInterface()
Sets the INTERFACE bit.
|
protected void |
setModifier(int mod)
Sets the bits in the underlying int that are specified by mod.
|
Modifiers |
setNative()
Sets the NATIVE bit.
|
Modifiers |
setPrivate()
Sets the PRIVATE bit.
|
Modifiers |
setProtected()
Sets the PROTECTED bit.
|
Modifiers |
setPublic()
Sets the PUBLIC bit.
|
Modifiers |
setStatic()
Sets the STATIC bit.
|
Modifiers |
setStrict()
Sets the STRICT bit.
|
Modifiers |
setSynchronized()
Sets the SYNCHRONIZED bit.
|
Modifiers |
setTransient()
Sets the TRANSIENT bit.
|
Modifiers |
setVisibility(java.lang.String visibility)
Sets the visibility from the given string.
|
Modifiers |
setVolatile()
Sets the VOLATILE bit.
|
java.lang.String |
toString()
Return a string describing the access modifier flags in the specified modifier.
|
Modifiers |
unsetAbstract()
Unsets the ABSTRACT bit.
|
Modifiers |
unsetFinal()
Unsets the FINAL bit.
|
Modifiers |
unsetInterface()
Unsets the INTERFACE bit.
|
protected void |
unsetModifier(int mod)
Unsets the bits in the underlying int that are specified by mod.
|
Modifiers |
unsetNative()
Unsets the NATIVE bit.
|
Modifiers |
unsetPrivate()
Unsets the PRIVATE bit.
|
Modifiers |
unsetProtected()
Unsets the PROTECTED bit.
|
Modifiers |
unsetPublic()
Unsets the PUBLIC bit.
|
Modifiers |
unsetStatic()
Unsets the STATIC bit.
|
Modifiers |
unsetStrict()
Unsets the STRICT bit.
|
Modifiers |
unsetSynchronized()
Unsets the SYNCHRONIZED bit.
|
Modifiers |
unsetTransient()
Unsets the TRANSIENT bit.
|
Modifiers |
unsetVolatile()
Unsets the VOLATILE bit.
|
public static final java.lang.String VIS_PUBLIC
public static final java.lang.String VIS_PROTECTED
public static final java.lang.String VIS_PRIVATE
public static final java.lang.String VIS_DEFAULT
public Modifiers()
public Modifiers(int initialValue)
public static Modifiers create()
public static Modifiers create(int initialValue)
public static Modifiers create(java.lang.reflect.Field field)
public static Modifiers of(java.lang.reflect.Member member)
Field
, Method
, Constructor
).public static Modifiers of(java.lang.Class<?> type)
public int getBits()
public Modifiers reset()
public boolean isAbstract()
public boolean isFinal()
public boolean isInterface()
public boolean isNative()
public boolean isPrivate()
public boolean isProtected()
public boolean isPublic()
public boolean isStatic()
public boolean isStrict()
public boolean isSynchronized()
public boolean isTransient()
public boolean isVolatile()
public boolean isDefaultVisibility()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Modifiers setAbstract()
public Modifiers setFinal()
public Modifiers setInterface()
public Modifiers setNative()
public Modifiers setPrivate()
public Modifiers setProtected()
public Modifiers setPublic()
public Modifiers setStatic()
public Modifiers setStrict()
public Modifiers setSynchronized()
public Modifiers setTransient()
public Modifiers setVolatile()
public Modifiers setDefaultVisibility()
public Modifiers setVisibility(java.lang.String visibility)
visibility
- One of the visibility stringspublic Modifiers unsetAbstract()
public Modifiers unsetFinal()
public Modifiers unsetInterface()
public Modifiers unsetNative()
public Modifiers unsetPrivate()
public Modifiers unsetProtected()
public Modifiers unsetPublic()
public Modifiers unsetStatic()
public Modifiers unsetStrict()
public Modifiers unsetSynchronized()
public Modifiers unsetTransient()
public Modifiers unsetVolatile()
protected void setModifier(int mod)
protected void unsetModifier(int mod)
protected void setBits(int newValue)