|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.javasource.JType
org.exolab.javasource.JStructure
org.exolab.javasource.AbstractJClass
org.exolab.javasource.JClass
org.exolab.javasource.JEnum
public final class JEnum
Describes the definition of a enum type class.
Field Summary |
---|
Fields inherited from class org.exolab.javasource.JType |
---|
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT |
Constructor Summary | |
---|---|
JEnum(java.lang.String name)
Construct JEnum with given name. |
Method Summary | |
---|---|
void |
addConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum. |
void |
addConstructor(JConstructor constructor)
Override to only allow private constructors. |
void |
addMember(JMember jMember)
Adds the given JMember to this JEnum. |
JEnumConstant |
getConstant(java.lang.String name)
Returns the member with the given name, or null if no member was found with the given name. |
int |
getConstantCount()
Returns the amount of enum constants. |
JEnumConstant[] |
getConstants()
Returns an array of all the JEnumConstant of this JEnum. |
void |
print(JSourceWriter jsw,
boolean classOnly)
Prints the source code for this JClass to the given JSourceWriter. |
Methods inherited from class org.exolab.javasource.JClass |
---|
addImport, changeLocalName, getSuperClass, getSuperClassQualifiedName, setSuperClass |
Methods inherited from class org.exolab.javasource.JStructure |
---|
addAnnotation, addImport, addImport, addImportInternal, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImportCount, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, print, printHeader, printImportDeclarations, printPackageDeclaration, removeAnnotation, removeImport, setHeader, toString |
Methods inherited from class org.exolab.javasource.JType |
---|
getLocalName, getName, isArray, isPrimitive, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JEnum(java.lang.String name)
name
- The name for this JEnum.Method Detail |
---|
public void addConstructor(JConstructor constructor)
addConstructor
in class AbstractJClass
constructor
- The constructor that should be added.public void addMember(JMember jMember)
addMember
in class JClass
jMember
- The JMember to add.public void addConstant(JEnumConstant jConstant)
jConstant
- The constant to add.public JEnumConstant getConstant(java.lang.String name)
name
- The name of the member to return.
public JEnumConstant[] getConstants()
public int getConstantCount()
public void print(JSourceWriter jsw, boolean classOnly)
print
in class JClass
jsw
- The JSourceWriter to print to. Must not be null.classOnly
- If true, the file header, package declaration, and
imports are not printed.SourceGenerator.setJClassPrinterType(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |