public final class JEnumConstant extends JAnnotatedElementHelper implements JMember
| Constructor and Description |
|---|
JEnumConstant(java.lang.String name)
Constructs a JEnumConstant with a given name and no initialization
arguements.
|
JEnumConstant(java.lang.String name,
java.lang.String[] arguments)
Constructs a JEnumConstant with a given name and initialization arguments.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMethod(JMethod jMethod)
Adds the given JMethod to this JEnumConstant.
|
void |
addMethod(JMethod jMethod,
boolean importReturnType)
Adds the given JMethod to this JEnumConstant.
|
void |
addMethods(JMethod[] jMethods)
Adds the given array of JMethods to this JEnumConstant.
|
java.lang.String[] |
getArguments()
Returns the arguments used by this constant.
|
JDocComment |
getComment()
Returns the JavaDoc comment describing this JEnumConstant.
|
JMethod |
getMethod(int index)
Returns the JMethod located at the specified index.
|
JMethod |
getMethod(java.lang.String name,
int startIndex)
Returns the first occurance of the method with the given name, starting
from the specified index.
|
JMethod[] |
getMethods()
Returns an array of all the JMethods of this JEnumConstant.
|
JModifiers |
getModifiers()
Returns the modifiers for this JEnumConstant.
|
java.lang.String |
getName()
Returns the name of this JEnumConstant.
|
static void |
main(java.lang.String[] args)
Test drive.
|
void |
print(JSourceWriter jsw)
prints this enum constant.
|
void |
setArguments(java.lang.String[] args)
Sets the arguments specified by this constant.
|
void |
setComment(JDocComment comment)
Sets the JavaDoc comment describing this JEnumConstant.
|
void |
setComment(java.lang.String comment)
Sets the JavaDoc comment describing this JEnumConstant.
|
void |
setName(java.lang.String name)
Sets the name of this JEnumConstant.
|
addAnnotation, getAnnotation, getAnnotations, hasAnnotations, isAnnotationPresent, printAnnotations, removeAnnotationpublic JEnumConstant(java.lang.String name)
name - name of the constantpublic JEnumConstant(java.lang.String name,
java.lang.String[] arguments)
name - name of the constantarguments - the initialization arguments providedpublic JModifiers getModifiers()
getModifiers in interface JMemberpublic void setArguments(java.lang.String[] args)
args - initialization arguments for this constantpublic java.lang.String[] getArguments()
public void addMethod(JMethod jMethod)
jMethod - the JMethod to addpublic void addMethod(JMethod jMethod, boolean importReturnType)
jMethod - the JMethod to addimportReturnType - true if we add the importReturnType to the class
import lists. It could be useful to set it to false when all
types are fully qualified.public void addMethods(JMethod[] jMethods)
jMethods - the array of JMethod to addpublic JMethod[] getMethods()
public JMethod getMethod(java.lang.String name, int startIndex)
name - the name of the method to look forstartIndex - the starting index to begin the searchpublic JMethod getMethod(int index)
index - the index of the JMethod to return.public void setName(java.lang.String name)
name - the name of this JEnumConstantpublic java.lang.String getName()
public void setComment(JDocComment comment)
comment - the JavaDoc comment for this JEnumConstant.public void setComment(java.lang.String comment)
comment - the JavaDoc comment for this JEnumConstantpublic JDocComment getComment()
public void print(JSourceWriter jsw)
jsw - public static void main(java.lang.String[] args)
args - command-line argumentsIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com