public class JModifiers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
isAbstract
A flag indicating whether or not the object associated
with this JModifiers is abstract
|
private boolean |
isFinal
A flag indicating whether or not the object associated
with this JModifiers is final
|
private boolean |
isStatic
A flag indicating whether or not the object associated
with this JModifiers is static
|
private boolean |
isTransient
A flag indicating whether or not the object associated
with this JModifiers is transient
|
private static java.lang.String |
sAbstract |
private static java.lang.String |
sFinal |
private static java.lang.String |
sPackage |
private static java.lang.String |
sPrivate |
private static java.lang.String |
sProtected |
private static java.lang.String |
sPublic |
private static java.lang.String |
sStatic |
private static java.lang.String |
sTransient |
private short |
visibility
The visibility
|
private static short |
vPackage |
private static short |
vPrivate |
private static short |
vProtected |
private static short |
vPublic |
Modifier | Constructor and Description |
---|---|
|
JModifiers()
Creates a new JModifiers class, by default the
modifiers presented are public.
|
private |
JModifiers(short visibility,
boolean isStatic,
boolean isFinal)
Creates a new JModifiers
|
Modifier and Type | Method and Description |
---|---|
JModifiers |
copy()
Creates a copy of this JModifiers
|
boolean |
isAbstract()
Returns true if the abstract qualifier is present.
|
boolean |
isFinal()
Returns true if the final qualifier is present.
|
boolean |
isPackage()
Returns true if the modifier represented is package (= without qualifier).
|
boolean |
isPrivate()
Returns true if the modifier represented is private.
|
boolean |
isProtected()
Returns true if the modifier represented is protected.
|
boolean |
isPublic()
Returns true if the modifier represented is public.
|
boolean |
isStatic()
Returns true if the modifier represented is static.
|
boolean |
isTransient()
Returns true if the modifier represented is transient.
|
void |
makePackage()
Changes the visibility qualifier to package (= without qualifier).
|
void |
makePrivate()
Changes the visibility qualifier to "private"
|
void |
makeProtected()
Changes the visibility qualifier to "protected"
|
void |
makePublic()
Changes the visibility qualifier to "public"
|
void |
setAbstract(boolean isAbstract)
Sets whether or not the "abstract" qualifier is present
This applies only to methods or classes. |
void |
setFinal(boolean isFinal)
Sets whether or not the "final" qualifier is present
|
void |
setStatic(boolean isStatic)
Sets whether or not the "static" qualifier is present
|
void |
setTransient(boolean isTransient)
Sets whether or not the "transient" qualifier is present
|
java.lang.String |
toString()
Returns the String represetation of this JModifiers
|
private static final java.lang.String sAbstract
private static final java.lang.String sFinal
private static final java.lang.String sPrivate
private static final java.lang.String sProtected
private static final java.lang.String sPackage
private static final java.lang.String sPublic
private static final java.lang.String sStatic
private static final java.lang.String sTransient
private static final short vPrivate
private static final short vProtected
private static final short vPublic
private static final short vPackage
private short visibility
private boolean isStatic
private boolean isFinal
private boolean isAbstract
private boolean isTransient
public JModifiers()
private JModifiers(short visibility, boolean isStatic, boolean isFinal)
visibility
- the visibile qualifierisStatic
- a boolean indicating the static qualifier.
A value of true indicates that this static qualifier is present.isFinal
- a boolean indicating the final qualifier. A value
of true indicates that the final qualifier is present.public JModifiers copy()
public void makePrivate()
public void makeProtected()
public void makePublic()
public void makePackage()
public boolean isAbstract()
public boolean isFinal()
public boolean isPrivate()
public boolean isProtected()
public boolean isPublic()
public boolean isPackage()
public boolean isStatic()
public boolean isTransient()
public void setAbstract(boolean isAbstract)
isAbstract
- is a boolean which when true will indicate
that the abstract qualifier should be presentpublic void setFinal(boolean isFinal)
isFinal
- is a boolean which when true will indicate
the final qualifiter is presentpublic void setStatic(boolean isStatic)
isStatic
- is a boolean which when true will indicate
the "static" qualifiter is presentpublic void setTransient(boolean isTransient)
isTransient
- is a boolean which when true will indicate
the "transient" qualifiter is presentpublic java.lang.String toString()
toString
in class java.lang.Object