|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.metadata.AbstractType
public abstract class AbstractType
Abstract type implementation.
| Field Summary |
|---|
| Fields inherited from interface de.mguennewig.pobjects.metadata.Type |
|---|
CLASS_NAME, TYPE_NAME |
| Constructor Summary | |
|---|---|
AbstractType()
Creates a new type. |
|
| Method Summary | |
|---|---|
java.lang.String |
format(java.lang.Object value)
Map value to its string representation. |
java.lang.String |
formatNative(java.lang.Object value)
Map value from its `native' string representation to its
internal representation based on the type. |
Description |
getDescription()
|
java.lang.String |
getTypeClass()
Returns the fully qualified class name of the type class that is used instead of this one. |
java.lang.String |
name(int variant)
Returns different names depending on variant for the code
generator. |
java.lang.Object |
parse(java.lang.String value)
Map value to its internal representation. |
void |
setDescription(Description description)
|
void |
setTypeClass(java.lang.String typeClass)
Sets the fully qualified class name of the type class that should be used instead of this one. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.mguennewig.pobjects.metadata.Type |
|---|
addMap, checkConstraints, checkSyntax, expand, getJavaClass, getMap, getMaxFieldSize, getResult, getResultInc, isScalar, labelToValue, parseNative, setParam, valueToLabel |
| Constructor Detail |
|---|
public AbstractType()
| Method Detail |
|---|
public final Description getDescription()
getDescription in interface Typepublic final void setDescription(Description description)
setDescription in interface Typepublic java.lang.String formatNative(java.lang.Object value)
value from its `native' string representation to its
internal representation based on the type.
This mapping is a one-to-one mapping of string values to the type's
value set, without any translation based on MapItems associated
with the type.
For example, an integer type's implementation would accept a value like `1' and translate it to the string `&dblquote;1&dblquote;', independent of any label associated with the value `1'.
The value null is always mapped to the empty string.
formatNative in interface Typejava.lang.IllegalArgumentException - if value is not in this
type's value set. For example a String when we expect an
Integer.Type.getJavaClass()public java.lang.String format(java.lang.Object value)
value to its string representation.
If value matches one of the MapItem.getValue()s
associated with this type, then it return its associated label.
Otherwise, delegate the job to formatNative(java.lang.Object).
format in interface Typejava.lang.IllegalArgumentException - if value is not in this
type's value set. For example a String when we expect an
Integer.Type.addMap(MapItem),
formatNative(Object),
Type.valueToLabel(Object,ObjectRef)
public java.lang.Object parse(java.lang.String value)
throws PObjSyntaxException
value to its internal representation.
If value matches one of the labels associated with this
type, then it returns its associated value. Otherwise, delegates the job
to Type.parseNative(String).
Furthermore the syntax of the value is checked.
parse in interface TypePObjSyntaxException - if value couldn't be parsed as a
string representation of this type.Type.addMap(MapItem),
Type.labelToValue(String,ObjectRef),
Type.checkSyntax(String),
Type.parseNative(String)public final java.lang.String getTypeClass()
getTypeClass in interface Typenull if this type class is used, otherwise the
fully qualified class name that should be used.public final void setTypeClass(java.lang.String typeClass)
setTypeClass in interface Typepublic java.lang.String name(int variant)
variant for the code
generator.
name in interface Typejava.lang.IllegalArgumentException - if variant is unknown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||