butler.sql.metadata
Class DateDatatype

java.lang.Object
  extended by butler.sql.metadata.DefaultDatatype
      extended by butler.sql.metadata.DateDatatype
All Implemented Interfaces:
Datatype

public class DateDatatype
extends DefaultDatatype

Implementation of Datatype for dates.

Author:
Fredrik Bertilsson

Constructor Summary
DateDatatype(boolean timestamp)
           
DateDatatype(boolean timestamp, boolean timeOfDay)
           
DateDatatype(boolean timestamp, boolean timeOfDay, java.text.Format format)
           
DateDatatype(boolean timestamp, java.text.Format format)
           
DateDatatype(int type)
           
DateDatatype(int type, boolean timeOfDay)
           
DateDatatype(int type, boolean timeOfDay, java.text.Format format)
           
 
Method Summary
 java.lang.Object db2obj(java.lang.Object obj)
          Converts from database format to java object format.
 java.text.Format getFormat()
          Returns Format instance.
 java.lang.Class getJavaClass()
          Returns the java class that is used for this datatype.
 int getSize()
           
 int getType()
           
 boolean isTimeOfDay()
           
 boolean isTimestamp()
           
 java.lang.Object obj2db(java.lang.Object obj)
          Converts from java object format to database format.
 java.lang.Object xml2obj(java.lang.String xml)
          Converts from xml string format to java object format.
 
Methods inherited from class butler.sql.metadata.DefaultDatatype
getDatatype, getDecimalDigits, getInstance, getMaskFormatter, getOperators, obj2xml, parse, toXML, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateDatatype

public DateDatatype(boolean timestamp)

DateDatatype

public DateDatatype(boolean timestamp,
                    java.text.Format format)

DateDatatype

public DateDatatype(boolean timestamp,
                    boolean timeOfDay)

DateDatatype

public DateDatatype(int type)

DateDatatype

public DateDatatype(int type,
                    boolean timeOfDay)

DateDatatype

public DateDatatype(int type,
                    boolean timeOfDay,
                    java.text.Format format)

DateDatatype

public DateDatatype(boolean timestamp,
                    boolean timeOfDay,
                    java.text.Format format)
Method Detail

getFormat

public java.text.Format getFormat()
                           throws java.lang.Exception
Description copied from interface: Datatype
Returns Format instance.

Specified by:
getFormat in interface Datatype
Overrides:
getFormat in class DefaultDatatype
Throws:
java.lang.Exception

xml2obj

public java.lang.Object xml2obj(java.lang.String xml)
                         throws java.lang.Exception
Description copied from interface: Datatype
Converts from xml string format to java object format.

Specified by:
xml2obj in interface Datatype
Overrides:
xml2obj in class DefaultDatatype
Throws:
java.lang.Exception

obj2db

public java.lang.Object obj2db(java.lang.Object obj)
                        throws java.lang.Exception
Description copied from interface: Datatype
Converts from java object format to database format.

Specified by:
obj2db in interface Datatype
Overrides:
obj2db in class DefaultDatatype
Throws:
java.lang.Exception

db2obj

public java.lang.Object db2obj(java.lang.Object obj)
                        throws java.lang.Exception
Description copied from interface: Datatype
Converts from database format to java object format.

Specified by:
db2obj in interface Datatype
Overrides:
db2obj in class DefaultDatatype
Throws:
java.lang.Exception

isTimestamp

public boolean isTimestamp()

isTimeOfDay

public boolean isTimeOfDay()

getJavaClass

public java.lang.Class getJavaClass()
                             throws java.lang.Exception
Description copied from interface: Datatype
Returns the java class that is used for this datatype.

Specified by:
getJavaClass in interface Datatype
Overrides:
getJavaClass in class DefaultDatatype
Throws:
java.lang.Exception

getType

public int getType()
            throws java.lang.Exception
Specified by:
getType in interface Datatype
Overrides:
getType in class DefaultDatatype
Throws:
java.lang.Exception

getSize

public int getSize()
Specified by:
getSize in interface Datatype
Overrides:
getSize in class DefaultDatatype