|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtualweaver.xotics.datamodel.datatype.XdtEnum
Base abstract class to implement two forms of enumeration : standard or partial. The standard form defines an enum type whose value belongs to a finite set of possible constant values. The partial form defines an enum type whose value can be either choosen from a set of possible constants or any other value of a predefined datatype. As for other datatypes in this package, value is set at instance creation only.
Constructor Summary | |
protected |
XdtEnum(boolean part,
java.lang.Object val,
XdtBidiMap v2s)
Derived class can use this constructor to create a new instance whose value comes from param val . |
protected |
XdtEnum(boolean part,
XdtBidiMap v2s,
java.lang.String strValue)
Derived class can use this constructor to create a new instance whose value comes from string param strValue . |
Method Summary | |
protected java.lang.Object |
createValue(java.lang.String str)
Converts param str into appropriate value. |
boolean |
equals(java.lang.Object o)
Default implementation of equality. |
protected java.lang.String |
getAsString()
Converts stored value into string representation. |
static java.lang.Class |
getContentPropertyEditorClass()
This method can be overriden for partial enum type wanting to give a specific PropertyEditor class to edit specific values. |
static XdtEnum[] |
getEnumSpace()
Returns the list of constant values of the enum type, as an array of enum constants. |
java.lang.Object |
getValueAsObject()
Returns the internal value |
abstract java.lang.Class |
getValueClass()
Returns the type class of internal value. |
static boolean |
isPartEnum()
This method returns null, but must be overriden to return true if derived type is a partial enum type. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected XdtEnum(boolean part, XdtBidiMap v2s, java.lang.String strValue) throws java.lang.IllegalArgumentException
strValue
.
part
- tells whether this enum type is partialv2s
- a bidi map containing mapping between enumeration values and their string representation.strValue
- string value of this
java.lang.IllegalArgumentException
- if strValue
is invalid.protected XdtEnum(boolean part, java.lang.Object val, XdtBidiMap v2s)
val
.
part
- tells whether this enum type is partialv2s
- a bidi map containing mapping between enumeration values and their string representation.val
- value of this
Method Detail |
protected java.lang.Object createValue(java.lang.String str) throws java.lang.IllegalArgumentException
str
into appropriate value. If this
is a standard
enum, this method uses internal bidi map to find value. If this
is a partial enum,
this method must be overriden.
str
- string to convert into value
java.lang.IllegalArgumentException
- if param str
is invalidprotected java.lang.String getAsString()
public static java.lang.Class getContentPropertyEditorClass()
PropertyEditor
class to edit specific values. By default this method
returns null as there is already a property editor assigned to edit standard enum type.
PropertyEditor
.public static boolean isPartEnum()
public abstract java.lang.Class getValueClass()
public java.lang.String toString()
public java.lang.Object getValueAsObject()
public static XdtEnum[] getEnumSpace()
public boolean equals(java.lang.Object o)
this
.
o
- external object to compare to
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |