|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.javasource.JAnnotatedElementHelper
org.exolab.javasource.JEnumConstant
public class JEnumConstant
Class describes the definition of a enum constant
Constructor Summary | |
---|---|
JEnumConstant(java.lang.String name)
Constructs a JEnumConstant with a given name |
|
JEnumConstant(java.lang.String name,
java.lang.String[] arguments)
Constructs a JEnumConstant with a given name |
Method Summary | |
---|---|
void |
addMethod(JMethod jMethod)
Adds the given JMethod to this JClass |
void |
addMethod(JMethod jMethod,
boolean importReturnType)
Adds the given JMethod to this JClass |
void |
addMethods(JMethod[] jMethods)
Adds the given array of JMethods to this JClass |
java.lang.String[] |
getArguments()
Returns the arguments used by this constant |
JDocComment |
getComment()
Returns the comment describing this member. |
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 JClass |
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)
Outputs the enum constant |
void |
setArguments(java.lang.String[] args)
Sets the arguments specified by this constant |
void |
setComment(JDocComment comment)
Sets the comment describing this member. |
void |
setComment(java.lang.String comment)
Sets the comment describing this member. |
void |
setName(java.lang.String name)
Sets the name of this JEnumConstant |
Methods inherited from class org.exolab.javasource.JAnnotatedElementHelper |
---|
addAnnotation, getAnnotation, getAnnotations, hasAnnotations, isAnnotationPresent, printAnnotations, removeAnnotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JEnumConstant(java.lang.String name)
name
- public JEnumConstant(java.lang.String name, java.lang.String[] arguments)
name
- arguments
- Method Detail |
---|
public JModifiers getModifiers()
getModifiers
in interface JMember
public void setArguments(java.lang.String[] args)
args
- public java.lang.String[] getArguments()
public void addMethod(JMethod jMethod)
jMethod,
- the JMethod to add
java.lang.IllegalArgumentException
- when the given
JMethod has the same name of an existing JMethod.public void addMethod(JMethod jMethod, boolean importReturnType) throws java.lang.IllegalArgumentException
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.
java.lang.IllegalArgumentException
- when the given
JMethod has the same name of an existing JMethod.public void addMethods(JMethod[] jMethods) throws java.lang.IllegalArgumentException
jMethods,
- the JMethod[] to add
java.lang.IllegalArgumentException
- when any of the given
JMethods has the same name of an existing JMethod.public 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 search
public JMethod getMethod(int index)
index
- the index of the JMethod to return.
public void setName(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the name of this JEnumConstant
java.lang.IllegalArgumentException
- when the
name is not a valid Java member namepublic java.lang.String getName()
getName
in interface JMember
public void setComment(JDocComment comment)
comment
- the JDocComment for this memberpublic void setComment(java.lang.String comment)
comment
- the JDocComment for this memberpublic JDocComment getComment()
public void print(JSourceWriter jsw)
jsw
- public static void main(java.lang.String[] args)
args
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |