Package org.jboss.jdeparser
Class ImplJEnumConstant
- java.lang.Object
-
- org.jboss.jdeparser.BasicJCommentable
-
- org.jboss.jdeparser.AbstractJDocCommentable
-
- org.jboss.jdeparser.BasicJAnnotatable
-
- org.jboss.jdeparser.ImplJEnumConstant
-
- All Implemented Interfaces:
JAnnotatable
,JClassItem
,JCommentable
,JDocCommentable
,JEnumConstant
,JSimpleArgs
class ImplJEnumConstant extends BasicJAnnotatable implements JEnumConstant, JClassItem
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JClassItem
JClassItem.Kind
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<AbstractJExpr>
args
private EnumConstantJClassDef
body
private EnumJClassDef
classDef
private java.lang.String
name
-
Fields inherited from interface org.jboss.jdeparser.JClassItem
SMART_NAME_SORT
-
-
Constructor Summary
Constructors Constructor Description ImplJEnumConstant(EnumJClassDef classDef, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JEnumConstant
arg(JExpr expr)
Add an argument.JExpr[]
arguments()
Get the arguments defined thus far.JClassDef
body()
Add an implementation body to this enum constant.(package private) EnumJClassDef
getClassDef()
JClassItem.Kind
getItemKind()
Get the kind of item.int
getModifiers()
Get the modifiers of this item.java.lang.String
getName()
Get the name of this element, if there is one.boolean
hasAllModifiers(int mods)
Determine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.boolean
hasAnyModifier(int mods)
Determine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.(package private) void
writeDirect(SourceFileWriter writer)
-
Methods inherited from class org.jboss.jdeparser.BasicJAnnotatable
annotate, annotate, annotate, writeAnnotations
-
Methods inherited from class org.jboss.jdeparser.AbstractJDocCommentable
deprecated, docComment, writeDocComments
-
Methods inherited from class org.jboss.jdeparser.BasicJCommentable
blockComment, lineComment, writeComments
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.jdeparser.JAnnotatable
annotate, annotate, annotate
-
Methods inherited from interface org.jboss.jdeparser.JCommentable
blockComment, lineComment
-
Methods inherited from interface org.jboss.jdeparser.JDocCommentable
deprecated, docComment
-
-
-
-
Field Detail
-
classDef
private final EnumJClassDef classDef
-
name
private final java.lang.String name
-
args
private java.util.ArrayList<AbstractJExpr> args
-
body
private EnumConstantJClassDef body
-
-
Constructor Detail
-
ImplJEnumConstant
ImplJEnumConstant(EnumJClassDef classDef, java.lang.String name)
-
-
Method Detail
-
getClassDef
EnumJClassDef getClassDef()
-
getName
public java.lang.String getName()
Description copied from interface:JClassItem
Get the name of this element, if there is one.- Specified by:
getName
in interfaceJClassItem
- Returns:
- the name, or
null
if there is none
-
arg
public JEnumConstant arg(JExpr expr)
Description copied from interface:JEnumConstant
Add an argument.- Specified by:
arg
in interfaceJEnumConstant
- Specified by:
arg
in interfaceJSimpleArgs
- Parameters:
expr
- the argument expression- Returns:
- this program element
-
body
public JClassDef body()
Description copied from interface:JEnumConstant
Add an implementation body to this enum constant.- Specified by:
body
in interfaceJEnumConstant
- Returns:
- the implementation class definition
-
arguments
public JExpr[] arguments()
Description copied from interface:JSimpleArgs
Get the arguments defined thus far.- Specified by:
arguments
in interfaceJSimpleArgs
- Returns:
- the arguments
-
writeDirect
void writeDirect(SourceFileWriter writer) throws java.io.IOException
- Throws:
java.io.IOException
-
getItemKind
public JClassItem.Kind getItemKind()
Description copied from interface:JClassItem
Get the kind of item.- Specified by:
getItemKind
in interfaceJClassItem
- Returns:
- the item kind
-
getModifiers
public int getModifiers()
Description copied from interface:JClassItem
Get the modifiers of this item.- Specified by:
getModifiers
in interfaceJClassItem
- Returns:
- the modifiers
- See Also:
JMod
-
hasAllModifiers
public boolean hasAllModifiers(int mods)
Description copied from interface:JClassItem
Determine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.- Specified by:
hasAllModifiers
in interfaceJClassItem
- Parameters:
mods
- the modifier(s)- Returns:
true
if all of the modifiers are present,false
otherwise
-
hasAnyModifier
public boolean hasAnyModifier(int mods)
Description copied from interface:JClassItem
Determine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.- Specified by:
hasAnyModifier
in interfaceJClassItem
- Parameters:
mods
- the modifier(s)- Returns:
true
if any if the modifiers are present,false
otherwise
-
-