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.AbstractJClass
              extended by org.exolab.javasource.JEnum
All Implemented Interfaces:
JAnnotatedElement

public final class JEnum
extends AbstractJClass

Describes the definition of a enum type class.

Version:
$Revision: 6669 $ $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
protected JEnum(java.lang.String name)
          Construct JEnum with given name.
 
Method Summary
 void addConstant(JEnumConstant jConstant)
          Adds the given JEnumConstant to this JEnum.
 void addImport(java.lang.String className)
          Adds the given import to this JStructure.
 void addMember(JMember jMember)
          Adds the given JMember to this JEnum.
 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.
 void print(JSourceWriter jsw, boolean classOnly)
          Prints the source code for this JClass to the given JSourceWriter.
 
Methods inherited from class org.exolab.javasource.AbstractJClass
addConstructor, addField, addMethod, addMethod, addMethods, createConstructor, createConstructor, createInnerClass, getConstructor, getConstructors, getField, getFields, getInnerClasses, getMethod, getMethod, getMethods, getStaticInitializationCode, print, printClassHeaders, printConstructors, printInnerClasses, printMemberVariables, printMethods, printStaticInitializers, removeConstructor, removeField, removeField, removeInnerClass, removeMethod
 
Methods inherited from class org.exolab.javasource.JStructure
addAnnotation, addImport, addImport, addImportInternal, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, print, printHeader, printImportDeclarations, printPackageDeclaration, removeAnnotation, removeImport, setHeader, toString
 
Methods inherited from class org.exolab.javasource.JType
getLocalName, getName, isArray, isPrimitive, setName
 
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)
Construct JEnum with given name.

Parameters:
name - The name for this JEnum.
Method Detail

addImport

public void addImport(java.lang.String className)
Adds the given import to this JStructure. Note: You cannot import from the "default package," so imports with no package are ignored.

Specified by:
addImport in class JStructure
Parameters:
className - Name of the class to import.

addMember

public void addMember(JMember jMember)
Adds the given JMember to this JEnum.

Specified by:
addMember in class JStructure
Parameters:
jMember - The JMember to add.

addConstant

public void addConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum.

Parameters:
jConstant - The constant to add.

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.

print

public void print(JSourceWriter jsw,
                  boolean classOnly)
Prints the source code for this JClass to the given JSourceWriter.

Specified by:
print in class AbstractJClass
Parameters:
jsw - The JSourceWriter to print to. Must not be null.
classOnly - If true, the file header, package declaration, and imports are not printed.


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