org.exolab.javasource
Class JEnum

java.lang.Object
  extended by org.exolab.javasource.JType
      extended by org.exolab.javasource.JStructure
          extended by org.exolab.javasource.JClass
              extended by org.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/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, _superClass
 
Fields inherited from class org.exolab.javasource.JStructure
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
addConstructor, addField, addImport, addMethod, addMethod, addMethods, createConstructor, createConstructor, createInnerClass, getConstructor, getConstructors, getField, getFields, getInnerClasses, getMethod, getMethod, getMethods, getStaticInitializationCode, getSuperClass, print, removeConstructor, removeField, removeField, removeInnerClass, removeMethod
 
Methods inherited from class org.exolab.javasource.JStructure
addAnnotation, addImport, addImport, addInterface, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getName, getPackageFromClassName, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, isValidClassName, print, print, printHeader, printImportDeclarations, printlnWithPrefix, printPackageDeclaration, removeAnnotation, removeImport, 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
Parameters:
jMember, - the JMember to add
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

Parameters:
jConstant, - the constant to add
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