org.exolab.castor.xml.schema.util

Class DatatypeHandler

public class DatatypeHandler extends Object

A class used for "guessing" the proper datatype of an XML attribute or an XML element with simpleContent.

Version: $Revision: 1.3 $ $Date: 2005/03/07 08:26:42 $

Author: Keith Visco

Field Summary
static StringBOOLEAN_TYPE
The name of the XML Schema boolean type
static StringDATETIME_TYPE
The name of the XML Schema dateTime type
static StringDATE_TYPE
The name of the XML Schema date type
static StringDOUBLE_TYPE
The name of the XML Schema double type
static StringFLOAT_TYPE
The name of the XML Schema float type
static StringINTEGER_TYPE
The name of the XML Schema integer type
static StringLONG_TYPE
The name of the XML Schema long type
static StringSTRING_TYPE
The name of the XML Schema string type
static StringTIME_TYPE
The name of the XML Schema time type
Method Summary
static StringguessType(String value)
Guesses the datatype for the given value.
protected static StringwhichType(String type1, String type2)
Guesses which datatype should be used.

Field Detail

BOOLEAN_TYPE

public static final String BOOLEAN_TYPE
The name of the XML Schema boolean type

DATETIME_TYPE

public static final String DATETIME_TYPE
The name of the XML Schema dateTime type

DATE_TYPE

public static final String DATE_TYPE
The name of the XML Schema date type

DOUBLE_TYPE

public static final String DOUBLE_TYPE
The name of the XML Schema double type

FLOAT_TYPE

public static final String FLOAT_TYPE
The name of the XML Schema float type

INTEGER_TYPE

public static final String INTEGER_TYPE
The name of the XML Schema integer type

LONG_TYPE

public static final String LONG_TYPE
The name of the XML Schema long type

STRING_TYPE

public static final String STRING_TYPE
The name of the XML Schema string type

TIME_TYPE

public static final String TIME_TYPE
The name of the XML Schema time type

Method Detail

guessType

public static String guessType(String value)
Guesses the datatype for the given value. When the type cannot be determined, it simply defaults to DatatypeHandler.STRING_TYPE.
Note: This may be a slow process.

Parameters: value the value to determine the type for

Returns: the type that the value may be

whichType

protected static String whichType(String type1, String type2)
Guesses which datatype should be used.
Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com