Package org.exolab.javasource
Class JEnum
java.lang.Object
org.exolab.javasource.JType
org.exolab.javasource.JStructure
org.exolab.javasource.AbstractJClass
org.exolab.javasource.JClass
org.exolab.javasource.JEnum
- All Implemented Interfaces:
JAnnotatedElement
Describes the definition of a enum type class.
- Version:
- $Revision: 8130 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Andrew Fawcett
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConstructor
(JConstructor constructor) Override to only allow private constructors.void
addEnumConstant
(JEnumConstant jEnumConstant) Adds the givenJEnumConstant
to thisJEnum
.void
getEnumConstant
(String name) Returns the member with the given name, or null if no member was found with the given name.int
Returns the number of enum constants.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.AbstractJClass
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
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, removeInterface, setHeader, toString
Methods inherited from class org.exolab.javasource.JType
getLocalName, getName, isArray, isPrimitive, setName
-
Constructor Details
-
JEnum
Construct JEnum with given name.- Parameters:
name
- The name for this JEnum.
-
-
Method Details
-
addConstructor
Override to only allow private constructors.- Overrides:
addConstructor
in classAbstractJClass
- Parameters:
constructor
- The constructor that should be added.
-
addMember
-
addEnumConstant
Adds the givenJEnumConstant
to thisJEnum
.- Parameters:
jEnumConstant
- The constant to add.
-
getEnumConstant
Returns the member with the given name, or null if no member was found with the given name.- Parameters:
name
- The name of the member to return.- Returns:
- The member with the given name, or null if no member was found with the given name.
-
getEnumConstants
Returns an array of all the JEnumConstant of this JEnum.- Returns:
- An array of all the JEnumConstant of this JEnum.
-
getEnumConstantCount
public int getEnumConstantCount()Returns the number of enum constants.- Returns:
- The number of enum constants.
-
print
Prints the source code for this JClass to the given JSourceWriter.
-