JAnnotatedElement
public final class JEnum extends JClass
Constructor | Description |
---|---|
JEnum(java.lang.String name) |
Construct JEnum with given name.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addConstructor(JConstructor constructor) |
Override to only allow private constructors.
|
void |
addEnumConstant(JEnumConstant jEnumConstant) |
Adds the given
JEnumConstant to this JEnum . |
void |
addMember(JMember jMember) |
|
JEnumConstant |
getEnumConstant(java.lang.String name) |
Returns the member with the given name, or null if no member was found
with the given name.
|
int |
getEnumConstantCount() |
Returns the number of enum constants.
|
JEnumConstant[] |
getEnumConstants() |
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.
|
addConstant, addField, addMethod, addMethod, addMethods, addSourceCode, createConstructor, createConstructor, createInnerClass, getConstant, getConstantCount, getConstants, getConstructor, getConstructors, getContructorsCount, getField, getFieldCount, getFields, getInnerClassCount, getInnerClasses, getMethod, getMethod, getMethodCount, getMethods, getSourceCodeEntries, getSourceCodeEntryCount, getStaticInitializationCode, print, printClassHeaders, printConstantDefinitions, printConstructors, printInnerClasses, printMemberVariables, printMethods, printSourceCodeFragments, printStaticInitializers, removeConstant, removeConstant, removeConstructor, removeField, removeField, removeInnerClass, removeMethod
addImport, changeLocalName, getSuperClass, getSuperClassQualifiedName, setSuperClass
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, removeInterface, setHeader, toString
getLocalName, getName, isArray, isPrimitive, setName
public JEnum(java.lang.String name)
name
- The name for this JEnum.public void addConstructor(JConstructor constructor)
addConstructor
in class AbstractJClass
constructor
- The constructor that should be added.public void addMember(JMember jMember)
public void addEnumConstant(JEnumConstant jEnumConstant)
JEnumConstant
to this JEnum
.jEnumConstant
- The constant to add.public JEnumConstant getEnumConstant(java.lang.String name)
name
- The name of the member to return.public JEnumConstant[] getEnumConstants()
public int getEnumConstantCount()
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)
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com