org.exolab.javasource

Class JEnum

Implemented Interfaces:
JAnnotatedElement

public final class JEnum
extends JClass

Describes the definition of a enum type class.
Version:
$Revision: 7331 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Author:
Andrew Fawcett

Field Summary

Fields inherited from class org.exolab.javasource.JType

BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT

Constructor Summary

JEnum(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(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)

Methods inherited from class org.exolab.javasource.JClass

addImport, addMember, changeLocalName, getSuperClass, getSuperClassQualifiedName, print, setSuperClass

Methods inherited from class org.exolab.javasource.AbstractJClass

addConstructor, addField, addMethod, addMethod, addMethods, createConstructor, createConstructor, createInnerClass, getConstructor, getConstructors, getContructorsCount, getField, getFieldCount, getFields, getInnerClassCount, getInnerClasses, getMethod, getMethod, getMethodCount, getMethods, getStaticInitializationCode, print, print, printClassHeaders, printConstructors, printInnerClasses, printMemberVariables, printMethods, printStaticInitializers, removeConstructor, removeField, removeField, removeInnerClass, removeMethod

Methods inherited from class org.exolab.javasource.JStructure

addAnnotation, addField, addImport, addImport, addImport, addImportInternal, addInterface, addMember, getAnnotatedElementHelper, getAnnotation, getAnnotations, getField, getFields, getFilename, getHeader, getImportCount, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, print, print, printHeader, printImportDeclarations, printPackageDeclaration, removeAnnotation, removeImport, setHeader, toString

Methods inherited from class org.exolab.javasource.JType

getLocalName, getName, isArray, isPrimitive, setName

Constructor Details

JEnum

public JEnum(String name)
Construct JEnum with given name.
Parameters:
name - The name for this JEnum.

Method Details

addConstant

public void addConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum.
Parameters:
jConstant - The constant to add.

addConstructor

public void addConstructor(JConstructor constructor)
Override to only allow private constructors.
Overrides:
addConstructor in interface AbstractJClass
Parameters:
constructor - The constructor that should be added.

addMember

public void addMember(JMember jMember)
Adds the given JMember to this JEnum.
Overrides:
addMember in interface JClass
Parameters:
jMember - The JMember to add.

getConstant

public JEnumConstant getConstant(String name)
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.

getConstantCount

public int getConstantCount()
Returns the amount of enum constants.
Returns:
The amount of enum constants.

getConstants

public JEnumConstant[] getConstants()
Returns an array of all the JEnumConstant of this JEnum.
Returns:
An array of all the JEnumConstant of this JEnum.

print

public void print(JSourceWriter jsw,
                  boolean classOnly)
Overrides:
print in interface JClass

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com