class ImplJEnumConstant extends BasicJAnnotatable implements JEnumConstant, JClassItem
JClassItem.Kind
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<AbstractJExpr> |
args |
private EnumConstantJClassDef |
body |
private EnumJClassDef |
classDef |
private java.lang.String |
name |
SMART_NAME_SORT
Constructor and Description |
---|
ImplJEnumConstant(EnumJClassDef classDef,
java.lang.String name) |
Modifier and Type | Method and 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) |
annotate, annotate, annotate, writeAnnotations
deprecated, docComment, writeDocComments
blockComment, lineComment, writeComments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
annotate, annotate, annotate
deprecated, docComment
blockComment, lineComment
private final EnumJClassDef classDef
private final java.lang.String name
private java.util.ArrayList<AbstractJExpr> args
private EnumConstantJClassDef body
ImplJEnumConstant(EnumJClassDef classDef, java.lang.String name)
EnumJClassDef getClassDef()
public java.lang.String getName()
JClassItem
getName
in interface JClassItem
null
if there is nonepublic JEnumConstant arg(JExpr expr)
JEnumConstant
arg
in interface JEnumConstant
arg
in interface JSimpleArgs
expr
- the argument expressionpublic JClassDef body()
JEnumConstant
body
in interface JEnumConstant
public JExpr[] arguments()
JSimpleArgs
arguments
in interface JSimpleArgs
void writeDirect(SourceFileWriter writer) throws java.io.IOException
java.io.IOException
public JClassItem.Kind getItemKind()
JClassItem
getItemKind
in interface JClassItem
public int getModifiers()
JClassItem
getModifiers
in interface JClassItem
JMod
public boolean hasAllModifiers(int mods)
JClassItem
hasAllModifiers
in interface JClassItem
mods
- the modifier(s)true
if all of the modifiers are present, false
otherwisepublic boolean hasAnyModifier(int mods)
JClassItem
hasAnyModifier
in interface JClassItem
mods
- the modifier(s)true
if any if the modifiers are present, false
otherwise