com.niggle.data.metadata
Class EnumField
java.lang.Object
|
+--com.niggle.data.metadata.Field
|
+--com.niggle.data.metadata.StringField
|
+--com.niggle.data.metadata.EnumField
- All Implemented Interfaces:
- FieldDescriptor, java.io.Serializable
- public class EnumField
- extends StringField
A String field that only admits a set
of possible string values.
- Author:
- Jonathan Revusky
- See Also:
- Serialized Form
Method Summary |
void |
checkValidValue(Record rec,
java.lang.Object value)
Check whether this object is a valid value
for this field of the given record. |
java.lang.Object |
getObjectFromString(Record rec,
java.lang.String value)
Given the string representation of a field,
return its internal java object representation. |
java.lang.String[] |
getPossibleValues()
|
protected void |
init(org.w3c.dom.Element elem)
|
Methods inherited from class com.niggle.data.metadata.Field |
capitalizeFirstLetter, defaultValue, getLocalizedName, getName, getSQLType, hashCode, isFieldOf, isRequired, processDefaultValue, setDefaultValue, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
EnumField
public EnumField()
init
protected void init(org.w3c.dom.Element elem)
throws org.xml.sax.SAXException
- Overrides:
init
in class StringField
getObjectFromString
public java.lang.Object getObjectFromString(Record rec,
java.lang.String value)
throws MangledDataException
- Description copied from interface:
FieldDescriptor
- Given the string representation of a field,
return its internal java object representation.
Used in deserializing from a flat file.
- Overrides:
getObjectFromString
in class StringField
checkValidValue
public void checkValidValue(Record rec,
java.lang.Object value)
throws java.io.IOException
- Description copied from interface:
FieldDescriptor
- Check whether this object is a valid value
for this field of the given record. Used in the
core validity checks.
- Overrides:
checkValidValue
in class StringField
- Following copied from interface:
com.niggle.data.FieldDescriptor
- Throws:
java.io.IOException
- Description of Exception
getPossibleValues
public java.lang.String[] getPossibleValues()