com.niggle.data.metadata
Class DateField

java.lang.Object
  |
  +--com.niggle.data.metadata.Field
        |
        +--com.niggle.data.metadata.DateField
All Implemented Interfaces:
FieldDescriptor, java.io.Serializable

public class DateField
extends Field

A descriptor for a field that holds a date or timestamp (probably a misnomer, should be called TimeStampField)

Author:
Jonathan Revusky
See Also:
Serialized Form

Fields inherited from class com.niggle.data.metadata.Field
defaultValueString, sqlType
 
Constructor Summary
DateField()
           
 
Method Summary
 java.lang.Object defaultValue()
          returns this field's "default value".
 java.lang.Object getCopy(java.lang.Object o)
          Used when encapsulation requires Record::getFieldValue() to return a clone of an object.
 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 value)
          Given the string representation of a field, return its internal java object representation.
protected  void init(org.w3c.dom.Element element)
           
protected  void processDefaultValue()
           
 java.lang.String valueToString(java.lang.Object o)
          returns the preferred the String representation of the object in question.
 
Methods inherited from class com.niggle.data.metadata.Field
capitalizeFirstLetter, checkValidValue, getLocalizedName, getName, getSQLType, hashCode, isFieldOf, isRequired, normalize, setDefaultValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateField

public DateField()
Method Detail

init

protected void init(org.w3c.dom.Element element)
             throws org.xml.sax.SAXException
Overrides:
init in class Field

processDefaultValue

protected void processDefaultValue()
                            throws java.io.IOException
Overrides:
processDefaultValue 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

defaultValue

public java.lang.Object defaultValue()
Description copied from interface: FieldDescriptor
returns this field's "default value". By default, this will be null.
Overrides:
defaultValue in class Field

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.

getCopy

public java.lang.Object getCopy(java.lang.Object o)
Description copied from interface: FieldDescriptor
Used when encapsulation requires Record::getFieldValue() to return a clone of an object. In the case of immutable objects such as java.lang.String, getCopy() can just return the object passed in as a parameter.
Overrides:
getCopy in class Field
Following copied from interface: com.niggle.data.FieldDescriptor
Returns:
a copy of the object in question.

valueToString

public java.lang.String valueToString(java.lang.Object o)
Description copied from interface: FieldDescriptor
returns the preferred the String representation of the object in question. Used to persist to a flat file.
Overrides:
valueToString in class Field