com.thaiopensource.datatype.xsd
Class DatatypeLibraryImpl

java.lang.Object
  extended by com.thaiopensource.datatype.xsd.DatatypeLibraryImpl
All Implemented Interfaces:
DatatypeLibrary

public class DatatypeLibraryImpl
extends Object
implements DatatypeLibrary


Field Summary
private static String BYTE_MAX
           
private static String BYTE_MIN
           
private static String INT_MAX
           
private static String INT_MIN
           
private static String LANGUAGE_PATTERN
           
private static String LONG_MAX
           
private static String LONG_MIN
           
private  RegexEngine regexEngine
           
private static String SHORT_MAX
           
private static String SHORT_MIN
           
private  Hashtable typeTable
           
private static String UNSIGNED_BYTE_MAX
           
private static String UNSIGNED_INT_MAX
           
private static String UNSIGNED_LONG_MAX
           
private static String UNSIGNED_SHORT_MAX
           
 
Constructor Summary
DatatypeLibraryImpl()
           
 
Method Summary
 Datatype createDatatype(String type)
          Gets or creates a pre-defined type.
 DatatypeBuilder createDatatypeBuilder(String localName)
          Creates a new instance of DatatypeBuilder.
private static RegexEngine findRegexEngine()
           
(package private)  RegexEngine getRegexEngine()
           
private static DatatypeBase list(DatatypeBase base)
           
static void main(String[] args)
           
private static DatatypeBase restrictMax(DatatypeBase base, String limit)
           
private static DatatypeBase restrictMin(DatatypeBase base, String limit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeTable

private final Hashtable typeTable

regexEngine

private final RegexEngine regexEngine

LONG_MAX

private static final String LONG_MAX
See Also:
Constant Field Values

LONG_MIN

private static final String LONG_MIN
See Also:
Constant Field Values

INT_MAX

private static final String INT_MAX
See Also:
Constant Field Values

INT_MIN

private static final String INT_MIN
See Also:
Constant Field Values

SHORT_MAX

private static final String SHORT_MAX
See Also:
Constant Field Values

SHORT_MIN

private static final String SHORT_MIN
See Also:
Constant Field Values

BYTE_MAX

private static final String BYTE_MAX
See Also:
Constant Field Values

BYTE_MIN

private static final String BYTE_MIN
See Also:
Constant Field Values

UNSIGNED_LONG_MAX

private static final String UNSIGNED_LONG_MAX
See Also:
Constant Field Values

UNSIGNED_INT_MAX

private static final String UNSIGNED_INT_MAX
See Also:
Constant Field Values

UNSIGNED_SHORT_MAX

private static final String UNSIGNED_SHORT_MAX
See Also:
Constant Field Values

UNSIGNED_BYTE_MAX

private static final String UNSIGNED_BYTE_MAX
See Also:
Constant Field Values

LANGUAGE_PATTERN

private static final String LANGUAGE_PATTERN
See Also:
Constant Field Values
Constructor Detail

DatatypeLibraryImpl

public DatatypeLibraryImpl()
Method Detail

createDatatypeBuilder

public DatatypeBuilder createDatatypeBuilder(String localName)
                                      throws DatatypeException
Description copied from interface: DatatypeLibrary
Creates a new instance of DatatypeBuilder. The callee should throw a DatatypeException in case of an error.

Specified by:
createDatatypeBuilder in interface DatatypeLibrary
Parameters:
localName - The local name of the base type.
Returns:
A non-null valid datatype object.
Throws:
DatatypeException

getRegexEngine

RegexEngine getRegexEngine()
                     throws DatatypeException
Throws:
DatatypeException

restrictMax

private static DatatypeBase restrictMax(DatatypeBase base,
                                        String limit)

restrictMin

private static DatatypeBase restrictMin(DatatypeBase base,
                                        String limit)

list

private static DatatypeBase list(DatatypeBase base)

findRegexEngine

private static RegexEngine findRegexEngine()

createDatatype

public Datatype createDatatype(String type)
                        throws DatatypeException
Description copied from interface: DatatypeLibrary
Gets or creates a pre-defined type. This is just a short-cut of createDatatypeBuilder(typeLocalName).createDatatype(); The callee should throw a DatatypeException in case of an error.

Specified by:
createDatatype in interface DatatypeLibrary
Returns:
A non-null valid datatype object.
Throws:
DatatypeException

main

public static void main(String[] args)
                 throws DatatypeException
Throws:
DatatypeException