com.revusky.oreo.metadata
Class NumericalField

java.lang.Object
  |
  +--com.revusky.oreo.metadata.Field
        |
        +--com.revusky.oreo.metadata.NumericalField
All Implemented Interfaces:
FieldDescriptor, java.io.Serializable

public class NumericalField
extends Field

A descriptor for a field that holds a single numerical value.

Author:
Jonathan Revusky
See Also:
Serialized Form

Fields inherited from class com.revusky.oreo.metadata.Field
defaultValueString, properties, sqlType
 
Constructor Summary
NumericalField()
           
 
Method Summary
 void checkValidValue(Record rec, java.lang.Object value)
          Note that the min-max interval is [min, max) following python range semantics.
 java.lang.Class getJavaType()
          The kind of java object that can live in this record field.
 java.lang.Object getObjectFromString(Record rec, java.lang.String s)
          Given the string representation of a field, return its internal java object representation.
 void init(org.w3c.dom.Element element)
          If you extend this class and override this method, do make sure to call the super.init() at some point.
 java.lang.String normalize(java.lang.String s)
          "normalize" the string passed in.
protected  void processProperties()
           
 
Methods inherited from class com.revusky.oreo.metadata.Field
convertFromJDBC, defaultValue, getCopy, getLocalizedName, getName, getProperty, getSQLType, hashCode, isFieldOf, isRequired, processDefaultValue, processNormalization, setDefaultValue, toString, valueToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericalField

public NumericalField()
Method Detail

init

public void init(org.w3c.dom.Element element)
          throws org.xml.sax.SAXException
Description copied from class: Field
If you extend this class and override this method, do make sure to call the super.init() at some point.
Overrides:
init in class Field

processProperties

protected void processProperties()
                          throws org.xml.sax.SAXException
Overrides:
processProperties in class Field

getJavaType

public java.lang.Class getJavaType()
Description copied from interface: FieldDescriptor
The kind of java object that can live in this record field.
Overrides:
getJavaType in class Field

normalize

public java.lang.String normalize(java.lang.String s)
Description copied from interface: FieldDescriptor
"normalize" the string passed in. For example, with a case-insensitive string field, this method would return the lower case version of the string (or upper case if that is the "normal" form.)
Overrides:
normalize in class Field
Following copied from interface: com.revusky.oreo.FieldDescriptor
Returns:
the "normalized" string

getObjectFromString

public java.lang.Object getObjectFromString(Record rec,
                                            java.lang.String s)
                                     throws java.io.IOException
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.

checkValidValue

public void checkValidValue(Record rec,
                            java.lang.Object value)
                     throws java.io.IOException
Note that the min-max interval is [min, max) following python range semantics.
Overrides:
checkValidValue in class Field
Following copied from interface: com.revusky.oreo.FieldDescriptor
Throws:
java.io.IOException - Description of Exception