org.exolab.javasource
public class JEnumConstant extends JAnnotatedElementHelper implements JMember
Constructor Summary | |
---|---|
JEnumConstant(String name)
Constructs a JEnumConstant with a given name | |
JEnumConstant(String name, 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
|
String[] | getArguments()
Returns the arguments used by this constant |
JDocComment | getComment()
Returns the comment describing this member. |
JMethod | getMethod(String name, int startIndex)
Returns the first occurance of the method with the
given name, starting from the specified index.
|
JMethod | getMethod(int index)
Returns the JMethod located at the specified index
|
JMethod[] | getMethods()
Returns an array of all the JMethods of this JClass
|
JModifiers | getModifiers()
Returns the modifiers for this JEnumConstant |
String | getName()
Returns the name of this JEnumConstant |
static void | main(String[] args)
Test drive |
void | print(JSourceWriter jsw)
Outputs the enum constant |
void | setArguments(String[] args)
Sets the arguments specified by this constant |
void | setComment(JDocComment comment)
Sets the comment describing this member. |
void | setComment(String comment)
Sets the comment describing this member. |
void | setName(String name)
Sets the name of this JEnumConstant |
Parameters: name
Parameters: name arguments
Parameters: jMethod, the JMethod to add
Throws: IllegalArgumentException when the given JMethod has the same name of an existing JMethod.
Parameters: jMethod, the JMethod to add importReturnType 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.
Throws: IllegalArgumentException when the given JMethod has the same name of an existing JMethod.
Parameters: jMethods, the JMethod[] to add
Throws: IllegalArgumentException when any of the given JMethods has the same name of an existing JMethod.
Returns:
Returns: the comment describing this member, or null if no comment has been set.
Parameters: name the name of the method to look for startIndex the starting index to begin the search
Returns: the method if found, otherwise null.
Parameters: index the index of the JMethod to return.
Returns: the JMethod
Returns: an array of all the JMethods of this JClass
Returns: the modifiers for this JEnumConstant
Returns: the name of this JEnumConstant
Parameters: args
Parameters: jsw
Parameters: args
Parameters: comment the JDocComment for this member
Parameters: comment the JDocComment for this member
Parameters: name the name of this JEnumConstant
Throws: IllegalArgumentException when the name is not a valid Java member name