org.exolab.javasource
Class JEnumConstant
- JAnnotatedElement, JMember
public final class JEnumConstant
Describes the definition of a enum constant.
$Revision: 7331 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $JEnumConstant(String name) - Constructs a JEnumConstant with a given name and no initialization
arguements.
|
JEnumConstant(String name, String[] arguments) - Constructs a JEnumConstant with a given name and initialization arguments.
|
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.
|
int | getArgumentCount() - Returns the amount of arguments.
|
String[] | getArguments() - Returns the arguments used by this constant.
|
JDocComment | getComment() - Returns the JavaDoc comment describing this JEnumConstant.
|
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.
|
int | getMethodCount()
|
JMethod[] | getMethods() - Returns an array of all the JMethods of this JEnumConstant.
|
JModifiers | getModifiers() - Returns the modifiers for this JEnumConstant.
|
String | getName() - Returns the name of this JEnumConstant.
|
void | print(JSourceWriter jsw) - prints this enum constant.
|
void | setArguments(String[] args) - Sets the arguments specified by this constant.
|
void | setComment(String comment) - Sets the JavaDoc comment describing this JEnumConstant.
|
void | setComment(JDocComment comment) - Sets the JavaDoc comment describing this JEnumConstant.
|
void | setName(String name) - Sets the name of this JEnumConstant.
|
JEnumConstant
public JEnumConstant(String name)
Constructs a JEnumConstant with a given name and no initialization
arguements.
name
- Name of the constant.
JEnumConstant
public JEnumConstant(String name,
String[] arguments)
Constructs a JEnumConstant with a given name and initialization arguments.
name
- Name of the constant.arguments
- The initialization arguments provided.
addMethod
public void addMethod(JMethod jMethod)
Adds the given JMethod to this JEnumConstant.
jMethod
- The JMethod to add.
addMethod
public void addMethod(JMethod jMethod,
boolean importReturnType)
Adds the given JMethod to this JEnumConstant.
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.
addMethods
public void addMethods(JMethod[] jMethods)
Adds the given array of JMethods to this JEnumConstant.
jMethods
- The array of JMethod to add.
getArgumentCount
public int getArgumentCount()
Returns the amount of arguments.
getArguments
public String[] getArguments()
Returns the arguments used by this constant.
- The arguments used by this constant.
getComment
public JDocComment getComment()
Returns the JavaDoc comment describing this JEnumConstant.
- The JavaDoc comment describing this JEnumConstant, or null if
none has been set.
getMethod
public JMethod getMethod(String name,
int startIndex)
Returns the first occurance of the method with the given name, starting
from the specified index.
name
- The name of the method to look for.startIndex
- The starting index to begin the search.
- The method if found, otherwise null.
getMethod
public JMethod getMethod(int index)
Returns the JMethod located at the specified index.
index
- The index of the JMethod to return.
getMethodCount
public int getMethodCount()
getMethods
public JMethod[] getMethods()
Returns an array of all the JMethods of this JEnumConstant.
- An array of all the JMethods of this JEnumConstant.
getModifiers
public JModifiers getModifiers()
Returns the modifiers for this JEnumConstant.
- getModifiers in interface JMember
- The modifiers for this JEnumConstant.
getName
public String getName()
Returns the name of this JEnumConstant.
- getName in interface JMember
- The name of this JEnumConstant.
print
public void print(JSourceWriter jsw)
prints this enum constant.
jsw
- The JSourceWriter to print to. Must not be null.
setArguments
public void setArguments(String[] args)
Sets the arguments specified by this constant.
args
- Initialization arguments for this constant.
setComment
public void setComment(String comment)
Sets the JavaDoc comment describing this JEnumConstant.
comment
- The JavaDoc comment for this JEnumConstant.
setComment
public void setComment(JDocComment comment)
Sets the JavaDoc comment describing this JEnumConstant.
comment
- The JavaDoc comment for this JEnumConstant.
setName
public void setName(String name)
Sets the name of this JEnumConstant.
name
- The name of this JEnumConstant.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com