|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ws.jaxme.js.pattern.TypesafeEnumerationGenerator
public class TypesafeEnumerationGenerator
This class is a generator for the typesafe enumeration pattern. It creates a class that contains only a few, specified instances. Other instances cannot be created.
Any instance has a name and a value. The name
Nested Class Summary | |
---|---|
static class |
TypesafeEnumerationGenerator.Item
|
Constructor Summary | |
---|---|
TypesafeEnumerationGenerator()
|
Method Summary | |
---|---|
JavaSource |
generate(JavaSourceFactory pFactory,
JavaQName pTargetClass,
TypesafeEnumerationGenerator.Item[] pItems)
Generates a new typesafe enumeration. |
JavaInnerClass |
generate(JavaSource pSource,
java.lang.String pName,
TypesafeEnumerationGenerator.Item[] pItems)
Generates a new typesafe enumeration, which is an inner class of the class pSource . |
boolean |
isAddingEquals()
Returns whether the generator should add implementations for the methods Object.equals(java.lang.Object) and Object.hashCode()
or not. |
void |
setAddingEquals(boolean pAddingEquals)
Sets whether the generator should add implementations for the methods Object.equals(java.lang.Object) and Object.hashCode()
or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypesafeEnumerationGenerator()
Method Detail |
---|
public void setAddingEquals(boolean pAddingEquals)
Sets whether the generator should add implementations for the methods
Object.equals(java.lang.Object)
and Object.hashCode()
or not. Defaults to true.
public boolean isAddingEquals()
Returns whether the generator should add implementations for the methods
Object.equals(java.lang.Object)
and Object.hashCode()
or not. Defaults to true.
public JavaSource generate(JavaSourceFactory pFactory, JavaQName pTargetClass, TypesafeEnumerationGenerator.Item[] pItems)
Generates a new typesafe enumeration.
pFactory
- The factory to use for generating the items.pTargetClass
- Fully qualified name of the class being generated.pItems
- The enumeration items; a public, static, final instance
will be generated for any element in the arraypublic JavaInnerClass generate(JavaSource pSource, java.lang.String pName, TypesafeEnumerationGenerator.Item[] pItems)
Generates a new typesafe enumeration, which is an inner class of
the class pSource
.
pSource
- The class, which shall have an inner classpName
- Name of the inner classpItems
- The enumeration items; a public, static, final instance
will be generated for any element in the array
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |