butler.sql.metadata
Interface Datatype

All Known Implementing Classes:
BlobDatatype, BooleanDatatype, CodeDatatype, DateDatatype, DateIntervalDatatype, DefaultDatatype, DurationDatatype, EnumDatatype, ImageDatatype, IntervalDatatype, MoneyDatatype, MonthDatatype, NumericDatatype, OperationType.Datatype, PasswordDatatype, StringDatatype, StringDatatype.StringLikeDatatype, TextDatatype, TimeOfDayDatatype, TimeUnitDatatype, WeekdayDatatype, YearDatatype

public interface Datatype

Definition of a datatype. This class should not be implemented directly. Instead subclass DefaultDatatype.

Author:
Fredrik Bertilsson

Method Summary
 java.lang.Object db2obj(java.lang.Object obj)
          Converts from database format to java object format.
 Datatype getDatatype(Operator op)
          Returns a specific datatype that should be used with the given operator.
 int getDecimalDigits()
           
 java.text.Format getFormat()
          Returns Format instance.
 java.lang.Class getJavaClass()
          Returns the java class that is used for this datatype.
 java.util.List getOperators()
          Returns the operators that have meaning on this datatype.
 int getSize()
           
 int getType()
           
 java.lang.Object obj2db(java.lang.Object obj)
          Converts from java object format to database format.
 java.lang.String obj2xml(java.lang.Object obj)
          Converts from java object format to xml string format.
 void toXML(org.xml.sax.ContentHandler handler)
          Builds an xml representation of this object.
 void validate(java.lang.Object value)
          Validated column value.
 java.lang.Object xml2obj(java.lang.String xml)
          Converts from xml string format to java object format.
 

Method Detail

obj2db

java.lang.Object obj2db(java.lang.Object obj)
                        throws java.lang.Exception
Converts from java object format to database format.

Throws:
java.lang.Exception

db2obj

java.lang.Object db2obj(java.lang.Object obj)
                        throws java.lang.Exception
Converts from database format to java object format.

Throws:
java.lang.Exception

xml2obj

java.lang.Object xml2obj(java.lang.String xml)
                         throws java.lang.Exception
Converts from xml string format to java object format.

Throws:
java.lang.Exception

obj2xml

java.lang.String obj2xml(java.lang.Object obj)
                         throws java.lang.Exception
Converts from java object format to xml string format.

Throws:
java.lang.Exception

getFormat

java.text.Format getFormat()
                           throws java.lang.Exception
Returns Format instance.

Throws:
java.lang.Exception

validate

void validate(java.lang.Object value)
              throws java.lang.Exception
Validated column value. If the value is invalid, an IllegalArgumentException should be thrown.

Throws:
java.lang.Exception

getOperators

java.util.List getOperators()
                            throws java.lang.Exception
Returns the operators that have meaning on this datatype. The first operator in the list (at index 0) will be the chosen operator if no other is actively chosen.

Throws:
java.lang.Exception

getJavaClass

java.lang.Class getJavaClass()
                             throws java.lang.Exception
Returns the java class that is used for this datatype.

Throws:
java.lang.Exception

toXML

void toXML(org.xml.sax.ContentHandler handler)
           throws java.lang.Exception
Builds an xml representation of this object.

Throws:
java.lang.Exception

getType

int getType()
            throws java.lang.Exception
Throws:
java.lang.Exception

getSize

int getSize()
            throws java.lang.Exception
Throws:
java.lang.Exception

getDecimalDigits

int getDecimalDigits()
                     throws java.lang.Exception
Throws:
java.lang.Exception

getDatatype

Datatype getDatatype(Operator op)
                     throws java.lang.Exception
Returns a specific datatype that should be used with the given operator. For example LikeDatatype or CompareDatatype

Throws:
java.lang.Exception