org.exolab.javasource
Class JEnum

java.lang.Object
  extended byorg.exolab.javasource.JType
      extended byorg.exolab.javasource.JStructure
          extended byorg.exolab.javasource.JClass
              extended byorg.exolab.javasource.JEnum
All Implemented Interfaces:
JAnnotatedElement

public class JEnum
extends JClass

Class describes the definition of a enum type class

Author:
Andrew Fawcett

Nested Class Summary
 
Nested classes inherited from class org.exolab.javasource.JClass
JClass.JInnerClass
 
Field Summary
 
Fields inherited from class org.exolab.javasource.JClass
_constructors, _fields, _innerClasses, _methods, _staticInitializer, _superClass, DEFAULT_HEADER, version
 
Fields inherited from class org.exolab.javasource.JType
Boolean, Byte, Char, Double, Float, Int, Long, Short
 
Constructor Summary
protected JEnum(java.lang.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 JAnnotationType
 JEnumConstant getConstant(java.lang.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(java.lang.String[] args)
          Test drive
 void print(JSourceWriter jsw)
          Prints the source code for this JEnum to the given JSourceWriter
 void setSuperClass(java.lang.String superClass)
          Sets the super Class that this class extends
 
Methods inherited from class org.exolab.javasource.JClass
addAnnotation, addConstructor, addField, addImport, addImport, addImport, addInterface, addInterface, addMethod, addMethod, addMethods, createConstructor, createConstructor, createInnerClass, getAnnotatedElementHelper, getAnnotation, getAnnotations, getConstructor, getConstructors, getField, getFields, getFilename, getHeader, getImports, getInnerClasses, getInterfaceCount, getInterfaces, getJDocComment, getMethod, getMethod, getMethods, getModifiers, getName, getPackageFromClassName, getPackageName, getStaticInitializationCode, getSuperClass, hasAnnotations, hasImport, isAnnotationPresent, isValidClassName, print, print, print, printHeader, printImportDeclarations, printlnWithPrefix, printPackageDeclaration, removeAnnotation, removeConstructor, removeField, removeField, removeImport, removeInnerClass, removeMethod, setHeader, setPackageName
 
Methods inherited from class org.exolab.javasource.JType
changePackage, createArray, getComponentType, getLocalName, getName, isArray, isPrimitive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JEnum

protected JEnum(java.lang.String name)
         throws java.lang.IllegalArgumentException
Parameters:
name -
Throws:
java.lang.IllegalArgumentException
Method Detail

addMember

public void addMember(JMember jMember)
               throws java.lang.IllegalArgumentException
Adds the given JMember to this JAnnotationType

Overrides:
addMember in class JClass
Throws:
java.lang.IllegalArgumentException - when the given JMember has the same name of an existing JEnumConstant or if the JMember is of an unrecognized class.

addConstant

public void addConstant(JEnumConstant jConstant)
                 throws java.lang.IllegalArgumentException
Adds the given JEnumConstant to this JEnum

Throws:
java.lang.IllegalArgumentException - when the given JEnumConstant has the same name of an existing JEnumConstant.

getConstant

public JEnumConstant getConstant(java.lang.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

setSuperClass

public void setSuperClass(java.lang.String superClass)
Description copied from class: JClass
Sets the super Class that this class extends

Overrides:
setSuperClass in class JClass
Parameters:
superClass - the super Class that this Class extends

print

public void print(JSourceWriter jsw)
Prints the source code for this JEnum to the given JSourceWriter

Overrides:
print in class JClass
Parameters:
jsw - the JSourceWriter to print to. [May not be null]

main

public static void main(java.lang.String[] args)
Test drive

Parameters:
args -


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