com.revusky.niggle.data.metadata
Class EnumField

java.lang.Object
  |
  +--com.revusky.niggle.data.metadata.Field
        |
        +--com.revusky.niggle.data.metadata.StringField
              |
              +--com.revusky.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

Fields inherited from class com.revusky.niggle.data.metadata.Field
defaultValueString, sqlType
 
Constructor Summary
EnumField()
           
 
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.revusky.niggle.data.metadata.StringField
decodeMultiLineString, encodeMultiLineString, getCopy, getJavaType, normalize, valueToString
 
Methods inherited from class com.revusky.niggle.data.metadata.Field
capitalizeFirstLetter, convertFromJDBC, 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
 

Constructor Detail

EnumField

public EnumField()
Method Detail

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.revusky.niggle.data.FieldDescriptor
Throws:
java.io.IOException - Description of Exception

getPossibleValues

public java.lang.String[] getPossibleValues()