org.exolab.javasource

Class JEnum

Implemented Interfaces:
JAnnotatedElement

public final class JEnum
extends JClass

Describes the definition of a enum type class.
Author:
Andrew Fawcett

Nested Class Summary

Nested classes/interfaces inherited from class org.exolab.javasource.JClass

JClass.JInnerClass

Field Summary

Fields inherited from class org.exolab.javasource.JClass

_constructors, _fields, _innerClasses, _methods, _staticInitializer

Fields inherited from class org.exolab.javasource.JType

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

Constructor Summary

JEnum(String name)

Method Summary

void
addConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum.
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.
JEnumConstant[]
getConstants()
Returns an array of all the JEnumConstant of this JEnum.
static void
main(String[] args)
Test drive.
void
print(JSourceWriter jsw)
Prints the source code for this JEnum to the given JSourceWriter.
void
setSuperClass(String superClass)

Methods inherited from class org.exolab.javasource.JClass

addConstructor, addField, addImport, addMember, addMethod, addMethod, addMethods, createConstructor, createConstructor, createInnerClass, getConstructor, getConstructors, getField, getFields, getInnerClasses, getMethod, getMethod, getMethods, getStaticInitializationCode, getSuperClass, getSuperClassQualifiedName, main, print, print, removeConstructor, removeField, removeField, removeInnerClass, removeMethod, setSuperClass

Methods inherited from class org.exolab.javasource.JStructure

addAnnotation, addField, addImport, addImport, addImport, addInterface, addInterface, addMember, getAnnotatedElementHelper, getAnnotation, getAnnotations, getField, getFields, getFilename, getHeader, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getName, getPackageFromClassName, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, isValidClassName, print, print, print, printHeader, printImportDeclarations, printPackageDeclaration, printlnWithPrefix, removeAnnotation, removeImport, setHeader, setPackageName

Methods inherited from class org.exolab.javasource.JType

changePackage, getLocalName, getName, getWrapperName, isArray, isPrimitive, toString

Constructor Details

JEnum

protected JEnum(String 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

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.

getConstants

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

main

public static void main(String[] args)
Test drive.
Overrides:
main in interface JClass
Parameters:
args - command-line arguments.

print

public void print(JSourceWriter jsw)
Prints the source code for this JEnum to the given JSourceWriter.
Overrides:
print in interface JClass
Parameters:
jsw - the JSourceWriter to print to. Must not be null.

setSuperClass

public void setSuperClass(String superClass)
Overrides:
setSuperClass in interface JClass
See Also:
{@inheritDoc}

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