|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pfsw.reflect.Modifiers
public class Modifiers
This class provides methods to conveniently set/unset modifier bits without having to fiddle around with bit logic.
Field Summary | |
---|---|
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 Summary | |
---|---|
Modifiers()
Initialize the new instance with default value 0. |
|
Modifiers(int initialValue)
Initialize the new instance with given value. |
Method Summary | |
---|---|
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. |
void |
reset()
Resets the modifier to 0. |
void |
setAbstract()
Sets the ABSTRACT bit. |
protected void |
setBits(int newValue)
|
void |
setDefaultVisibility()
Sets the visibility to default that means unset PUBLIC, PROTECTED, PRIVATE bits. |
void |
setFinal()
Sets the FINAL bit. |
void |
setInterface()
Sets the INTERFACE bit. |
protected void |
setModifier(int mod)
Sets the bits in the underlying int that are specified by mod. |
void |
setNative()
Sets the NATIVE bit. |
void |
setPrivate()
Sets the PRIVATE bit. |
void |
setProtected()
Sets the PROTECTED bit. |
void |
setPublic()
Sets the PUBLIC bit. |
void |
setStatic()
Sets the STATIC bit. |
void |
setStrict()
Sets the STRICT bit. |
void |
setSynchronized()
Sets the SYNCHRONIZED bit. |
void |
setTransient()
Sets the TRANSIENT bit. |
void |
setVisibility(java.lang.String visibility)
Sets the visibility from the given string. |
void |
setVolatile()
Sets the VOLATILE bit. |
java.lang.String |
toString()
Return a string describing the access modifier flags in the specified modifier. |
void |
unsetAbstract()
Unsets the ABSTRACT bit. |
void |
unsetFinal()
Unsets the FINAL bit. |
void |
unsetInterface()
Unsets the INTERFACE bit. |
protected void |
unsetModifier(int mod)
Unsets the bits in the underlying int that are specified by mod. |
void |
unsetNative()
Unsets the NATIVE bit. |
void |
unsetPrivate()
Unsets the PRIVATE bit. |
void |
unsetProtected()
Unsets the PROTECTED bit. |
void |
unsetPublic()
Unsets the PUBLIC bit. |
void |
unsetStatic()
Unsets the STATIC bit. |
void |
unsetStrict()
Unsets the STRICT bit. |
void |
unsetSynchronized()
Unsets the SYNCHRONIZED bit. |
void |
unsetTransient()
Unsets the TRANSIENT bit. |
void |
unsetVolatile()
Unsets the VOLATILE bit. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public Modifiers()
public Modifiers(int initialValue)
Method Detail |
---|
public int getBits()
protected void setBits(int newValue)
public void 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 void setAbstract()
public void setFinal()
public void setInterface()
public void setNative()
public void setPrivate()
public void setProtected()
public void setPublic()
public void setStatic()
public void setStrict()
public void setSynchronized()
public void setTransient()
public void setVolatile()
public void setDefaultVisibility()
public void setVisibility(java.lang.String visibility)
visibility
- One of the visibility stringspublic void unsetAbstract()
public void unsetFinal()
public void unsetInterface()
public void unsetNative()
public void unsetPrivate()
public void unsetProtected()
public void unsetPublic()
public void unsetStatic()
public void unsetStrict()
public void unsetSynchronized()
public void unsetTransient()
public void unsetVolatile()
protected void setModifier(int mod)
protected void unsetModifier(int mod)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |