org.exolab.javasource

Class JEnum

public class JEnum extends JClass

Class describes the definition of a enum type class

Author: Andrew Fawcett

Constructor Summary
protected JEnum(String name)
Method Summary
voidaddConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum
voidaddMember(JMember jMember)
Adds the given JMember to this JAnnotationType
JEnumConstantgetConstant(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 voidmain(String[] args)
Test drive
voidprint(JSourceWriter jsw)
Prints the source code for this JEnum to the given JSourceWriter
voidsetSuperClass(String superClass)

Constructor Detail

JEnum

protected JEnum(String name)

Parameters: name

Throws: IllegalArgumentException

Method Detail

addConstant

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

Parameters: jConstant, the constant to add

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

addMember

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

Parameters: jMember, the JMember to add

Throws: IllegalArgumentException when the given JMember has the same name of an existing JEnumConstant or if the JMember is of an unrecognized class.

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

Parameters: args

print

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

Parameters: jsw the JSourceWriter to print to. [May not be null]

setSuperClass

public void setSuperClass(String superClass)
Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com