Class JModifiers
- java.lang.Object
-
- org.codehaus.modello.plugin.java.javasource.JModifiers
-
public class JModifiers extends java.lang.Object
The set of modifiers for a Method or Member variable- Version:
- $Revision$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
isAbstract
A flag indicating whether or not the object associated with this JModifiers is abstractprivate boolean
isFinal
A flag indicating whether or not the object associated with this JModifiers is finalprivate boolean
isStatic
A flag indicating whether or not the object associated with this JModifiers is staticprivate boolean
isTransient
A flag indicating whether or not the object associated with this JModifiers is transientprivate 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 visibilityprivate static short
vPackage
private static short
vPrivate
private static short
vProtected
private static short
vPublic
-
Constructor Summary
Constructors Modifier Constructor 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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JModifiers
copy()
Creates a copy of this JModifiersboolean
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 presentvoid
setStatic(boolean isStatic)
Sets whether or not the "static" qualifier is presentvoid
setTransient(boolean isTransient)
Sets whether or not the "transient" qualifier is presentjava.lang.String
toString()
Returns the String represetation of this JModifiers
-
-
-
Field Detail
-
sAbstract
private static final java.lang.String sAbstract
- See Also:
- Constant Field Values
-
sFinal
private static final java.lang.String sFinal
- See Also:
- Constant Field Values
-
sPrivate
private static final java.lang.String sPrivate
- See Also:
- Constant Field Values
-
sProtected
private static final java.lang.String sProtected
- See Also:
- Constant Field Values
-
sPackage
private static final java.lang.String sPackage
- See Also:
- Constant Field Values
-
sPublic
private static final java.lang.String sPublic
- See Also:
- Constant Field Values
-
sStatic
private static final java.lang.String sStatic
- See Also:
- Constant Field Values
-
sTransient
private static final java.lang.String sTransient
- See Also:
- Constant Field Values
-
vPrivate
private static final short vPrivate
- See Also:
- Constant Field Values
-
vProtected
private static final short vProtected
- See Also:
- Constant Field Values
-
vPublic
private static final short vPublic
- See Also:
- Constant Field Values
-
vPackage
private static final short vPackage
- See Also:
- Constant Field Values
-
visibility
private short visibility
The visibility
-
isStatic
private boolean isStatic
A flag indicating whether or not the object associated with this JModifiers is static
-
isFinal
private boolean isFinal
A flag indicating whether or not the object associated with this JModifiers is final
-
isAbstract
private boolean isAbstract
A flag indicating whether or not the object associated with this JModifiers is abstract
-
isTransient
private boolean isTransient
A flag indicating whether or not the object associated with this JModifiers is transient
-
-
Constructor Detail
-
JModifiers
public JModifiers()
Creates a new JModifiers class, by default the modifiers presented are public.
-
JModifiers
private JModifiers(short visibility, boolean isStatic, boolean isFinal)
Creates a new JModifiers- Parameters:
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.
-
-
Method Detail
-
copy
public JModifiers copy()
Creates a copy of this JModifiers- Returns:
- the copy of this JModifiers
-
makePrivate
public void makePrivate()
Changes the visibility qualifier to "private"
-
makeProtected
public void makeProtected()
Changes the visibility qualifier to "protected"
-
makePublic
public void makePublic()
Changes the visibility qualifier to "public"
-
makePackage
public void makePackage()
Changes the visibility qualifier to package (= without qualifier).
-
isAbstract
public boolean isAbstract()
Returns true if the abstract qualifier is present.
This is only applicable to methods and classes.- Returns:
- true if the abstract qualifier is present
-
isFinal
public boolean isFinal()
Returns true if the final qualifier is present.
This is only applicable to methods and classes.- Returns:
- true if the final qualifier is present
-
isPrivate
public boolean isPrivate()
Returns true if the modifier represented is private.- Returns:
- true if the modifier represented is private.
-
isProtected
public boolean isProtected()
Returns true if the modifier represented is protected.- Returns:
- true if the modifier represented is protected.
-
isPublic
public boolean isPublic()
Returns true if the modifier represented is public.- Returns:
- true if the modifier represented is public.
-
isPackage
public boolean isPackage()
Returns true if the modifier represented is package (= without qualifier).- Returns:
- true if the modifier represented is package (= without qualifier).
-
isStatic
public boolean isStatic()
Returns true if the modifier represented is static.- Returns:
- true if the modifier represented is static.
-
isTransient
public boolean isTransient()
Returns true if the modifier represented is transient.- Returns:
- true if the modifier represented is transient.
-
setAbstract
public void setAbstract(boolean isAbstract)
Sets whether or not the "abstract" qualifier is present
This applies only to methods or classes.- Parameters:
isAbstract
- is a boolean which when true will indicate that the abstract qualifier should be present
-
setFinal
public void setFinal(boolean isFinal)
Sets whether or not the "final" qualifier is present- Parameters:
isFinal
- is a boolean which when true will indicate the final qualifiter is present
-
setStatic
public void setStatic(boolean isStatic)
Sets whether or not the "static" qualifier is present- Parameters:
isStatic
- is a boolean which when true will indicate the "static" qualifiter is present
-
setTransient
public void setTransient(boolean isTransient)
Sets whether or not the "transient" qualifier is present- Parameters:
isTransient
- is a boolean which when true will indicate the "transient" qualifiter is present
-
toString
public java.lang.String toString()
Returns the String represetation of this JModifiers- Overrides:
toString
in classjava.lang.Object
- Returns:
- the String represetation of this JModifiers
-
-