butler.sql.metadata
Class BooleanDatatype

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

public class BooleanDatatype
extends DefaultDatatype

Author:
Fredrik Bertilsson

Constructor Summary
BooleanDatatype()
           
BooleanDatatype(int type)
           
BooleanDatatype(java.lang.String trueValue, java.lang.String falseValue)
           
 
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.
 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.
static BooleanDatatype parseBooleanDatatype(org.dom4j.Element element)
           
 void toXML(org.xml.sax.ContentHandler handler)
          Builds an xml representation of this object.
 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, obj2xml, parse, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanDatatype

public BooleanDatatype()

BooleanDatatype

public BooleanDatatype(int type)

BooleanDatatype

public BooleanDatatype(java.lang.String trueValue,
                       java.lang.String falseValue)
Method Detail

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

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

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

getOperators

public java.util.List getOperators()
                            throws java.lang.Exception
Description copied from interface: Datatype
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.

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

parseBooleanDatatype

public static BooleanDatatype parseBooleanDatatype(org.dom4j.Element element)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

getType

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

getSize

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

toXML

public void toXML(org.xml.sax.ContentHandler handler)
           throws java.lang.Exception
Description copied from interface: Datatype
Builds an xml representation of this object.

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

getFormat

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

Specified by:
getFormat in interface Datatype
Overrides:
getFormat in class DefaultDatatype