org.exolab.castor.builder.types

Class XSType

Known Direct Subclasses:
XSAnyURI, XSBinary, XSBoolean, XSClass, XSDate, XSDateTime, XSDecimal, XSDuration, XSGDay, XSGMonth, XSGMonthDay, XSGYear, XSGYearMonth, XSId, XSIdRef, XSList, XSNCName, XSNMToken, XSPatternBase, XSTime

public abstract class XSType
extends java.lang.Object

The base XML Schema Type class
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:01 $
Author:
Keith Visco

Field Summary

static String
ANYURI_NAME
the name of the anyURI type.
static short
ANYURI_TYPE
static String
BASE64BINARY_NAME
The name of the base64Binary type
static short
BASE64BINARY_TYPE
static String
BOOLEAN_NAME
The name of the boolean type
static short
BOOLEAN_TYPE
static String
BYTE_NAME
The name of the byte type
static short
BYTE_TYPE
static short
CLASS
static short
COLLECTION
static String
DATETIME_NAME
The name of the the dateTime type
static short
DATETIME_TYPE
static String
DATE_NAME
The name of the date type
static short
DATE_TYPE
static String
DECIMAL_NAME
The name of the decimal type
static short
DECIMAL_TYPE
static String
DOUBLE_NAME
The name of the double type
static short
DOUBLE_TYPE
static String
DURATION_NAME
the name of the duration type
static short
DURATION_TYPE
static short
ENTITIES
static short
ENTITY
static String
FLOAT_NAME
The name of the float type
static short
FLOAT_TYPE
static String
GDAY_NAME
The name of the gDay type.
static short
GDAY_TYPE
static String
GMONTHDAY_NAME
The name of the gMonthDay type.
static short
GMONTHDAY_TYPE
static String
GMONTH_NAME
The name of the gMonth type.
static short
GMONTH_TYPE
static String
GYEARMONTH_NAME
The name of the gYearMonth type.
static short
GYEARMONTH_TYPE
static String
GYEAR_NAME
The name of the gYear type.
static short
GYEAR_TYPE
static String
HEXBINARY_NAME
The name of the hexBinary type
static short
HEXBINARY_TYPE
static String
IDREFS_NAME
The Name of the IDREFS type
static short
IDREFS_TYPE
static String
IDREF_NAME
The name of the IDREF type
static short
IDREF_TYPE
static String
ID_NAME
The name of the ID type
static short
ID_TYPE
static String
INTEGER_NAME
The name of the integer type
static short
INTEGER_TYPE
static String
INT_NAME
The name of the int type
static short
INT_TYPE
static String
LANGUAGE_NAME
The name of the language type.
static short
LANGUAGE_TYPE
static String
LONG_NAME
The name of the long type
static short
LONG_TYPE
static String
NAME_NAME
The name of the Name type
static short
NAME_TYPE
static String
NCNAME_NAME
The name of the NCName type
static short
NCNAME_TYPE
static String
NEGATIVE_INTEGER_NAME
The name of the negative-integer type
static short
NEGATIVE_INTEGER_TYPE
static String
NMTOKENS_NAME
The of the NMTOKENS type
static short
NMTOKENS_TYPE
static String
NMTOKEN_NAME
The name of the NMTOKEN type
static short
NMTOKEN_TYPE
static String
NON_NEGATIVE_INTEGER_NAME
The name of the non-positive-integer type
static short
NON_NEGATIVE_INTEGER_TYPE
static String
NON_POSITIVE_INTEGER_NAME
The name of the non-positive-integer type
static short
NON_POSITIVE_INTEGER_TYPE
static String
NORMALIZEDSTRING_NAME
The name of the normalizedString type.
static short
NORMALIZEDSTRING_TYPE
static String
NOTATION_NAME
the name of the notation type
static short
NOTATION_TYPE
static short
NULL
static String
POSITIVE_INTEGER_NAME
The name of the positive-integer type
static short
POSITIVE_INTEGER_TYPE
static String
QNAME_NAME
the name of the QName type
static short
QNAME_TYPE
static String
SHORT_NAME
The name of the short type
static short
SHORT_TYPE
static String
STRING_NAME
The name of the string type
static short
STRING_TYPE
static String
TIME_NAME
the name of the time type
static short
TIME_TYPE
static String
TOKEN_NAME
The name of the token type
static short
TOKEN_TYPE

Constructor Summary

XSType(short type)
Creates a new XSType of the given type

Method Summary

String
createFromJavaObjectCode(String variableName)
Returns the String necessary to convert an Object to an instance of this XSType.
String
createToJavaObjectCode(String variableName)
Returns the String necessary to convert an instance of this XSType to an Object.
protected static String
escapePattern(String str)
Escapes special characters in the given String so that it can be printed correctly.
protected static Enumeration
getFacets(SimpleType simpleType)
Returns a list of Facets from the simpleType (duplicate facets due to extension are filtered out)
abstract JType
getJType()
Returns the JType that this XSType represents
String
getName()
Returns the name of this XSType
short
getType()
Returns the type of this XSType
boolean
isDateTime()
Returns true if the XSType represents an XML Schema date/time type
boolean
isEnumerated()
Returns true if this XSType represents an enumerated type
boolean
isPrimitive()
String
newInstanceCode()
Returns the Java code neccessary to create a new instance of the JType associated with this XSType
void
setAsEnumertated(boolean enumerated)
Sets the enumerated flag for this XSClass
abstract void
setFacets(SimpleType simpleType)
Reads and sets the facets for XSType
abstract void
validationCode(JSourceCode jsc, String fixedValue, String fieldValidatorInstanceName)
Creates the validation code for an instance of this XSType.

Field Details

ANYURI_NAME

public static final String ANYURI_NAME
the name of the anyURI type.

ANYURI_TYPE

public static final short ANYURI_TYPE
Field Value:
17

BASE64BINARY_NAME

public static final String BASE64BINARY_NAME
The name of the base64Binary type

BASE64BINARY_TYPE

public static final short BASE64BINARY_TYPE
Field Value:
12

BOOLEAN_NAME

public static final String BOOLEAN_NAME
The name of the boolean type

BOOLEAN_TYPE

public static final short BOOLEAN_TYPE
Field Value:
11

BYTE_NAME

public static final String BYTE_NAME
The name of the byte type

BYTE_TYPE

public static final short BYTE_TYPE
Field Value:
38

CLASS

public static final short CLASS
Field Value:
0

COLLECTION

public static final short COLLECTION
Field Value:
45

DATETIME_NAME

public static final String DATETIME_NAME
The name of the the dateTime type

DATETIME_TYPE

public static final short DATETIME_TYPE
Field Value:
3

DATE_NAME

public static final String DATE_NAME
The name of the date type

DATE_TYPE

public static final short DATE_TYPE
Field Value:
5

DECIMAL_NAME

public static final String DECIMAL_NAME
The name of the decimal type

DECIMAL_TYPE

public static final short DECIMAL_TYPE
Field Value:
16

DOUBLE_NAME

public static final String DOUBLE_NAME
The name of the double type

DOUBLE_TYPE

public static final short DOUBLE_TYPE
Field Value:
15

DURATION_NAME

public static final String DURATION_NAME
the name of the duration type

DURATION_TYPE

public static final short DURATION_TYPE
Field Value:
2

ENTITIES

public static final short ENTITIES
Field Value:
29

ENTITY

public static final short ENTITY
Field Value:
28

FLOAT_NAME

public static final String FLOAT_NAME
The name of the float type

FLOAT_TYPE

public static final short FLOAT_TYPE
Field Value:
14

GDAY_NAME

public static final String GDAY_NAME
The name of the gDay type.

GDAY_TYPE

public static final short GDAY_TYPE
Field Value:
9

GMONTHDAY_NAME

public static final String GMONTHDAY_NAME
The name of the gMonthDay type.

GMONTHDAY_TYPE

public static final short GMONTHDAY_TYPE
Field Value:
8

GMONTH_NAME

public static final String GMONTH_NAME
The name of the gMonth type.

GMONTH_TYPE

public static final short GMONTH_TYPE
Field Value:
10

GYEARMONTH_NAME

public static final String GYEARMONTH_NAME
The name of the gYearMonth type.

GYEARMONTH_TYPE

public static final short GYEARMONTH_TYPE
Field Value:
6

GYEAR_NAME

public static final String GYEAR_NAME
The name of the gYear type.

GYEAR_TYPE

public static final short GYEAR_TYPE
Field Value:
7

HEXBINARY_NAME

public static final String HEXBINARY_NAME
The name of the hexBinary type

HEXBINARY_TYPE

public static final short HEXBINARY_TYPE
Field Value:
13

IDREFS_NAME

public static final String IDREFS_NAME
The Name of the IDREFS type

IDREFS_TYPE

public static final short IDREFS_TYPE
Field Value:
27

IDREF_NAME

public static final String IDREF_NAME
The name of the IDREF type

IDREF_TYPE

public static final short IDREF_TYPE
Field Value:
26

ID_NAME

public static final String ID_NAME
The name of the ID type

ID_TYPE

public static final short ID_TYPE
Field Value:
25

INTEGER_NAME

public static final String INTEGER_NAME
The name of the integer type

INTEGER_TYPE

public static final short INTEGER_TYPE
Field Value:
32

INT_NAME

public static final String INT_NAME
The name of the int type

INT_TYPE

public static final short INT_TYPE
Field Value:
36

LANGUAGE_NAME

public static final String LANGUAGE_NAME
The name of the language type.

LANGUAGE_TYPE

public static final short LANGUAGE_TYPE
Field Value:
22

LONG_NAME

public static final String LONG_NAME
The name of the long type

LONG_TYPE

public static final short LONG_TYPE
Field Value:
35

NAME_NAME

public static final String NAME_NAME
The name of the Name type

NAME_TYPE

public static final short NAME_TYPE
Field Value:
23

NCNAME_NAME

public static final String NCNAME_NAME
The name of the NCName type

NCNAME_TYPE

public static final short NCNAME_TYPE
Field Value:
24

NEGATIVE_INTEGER_NAME

public static final String NEGATIVE_INTEGER_NAME
The name of the negative-integer type

NEGATIVE_INTEGER_TYPE

public static final short NEGATIVE_INTEGER_TYPE
Field Value:
34

NMTOKENS_NAME

public static String NMTOKENS_NAME
The of the NMTOKENS type

NMTOKENS_TYPE

public static final short NMTOKENS_TYPE
Field Value:
31

NMTOKEN_NAME

public static final String NMTOKEN_NAME
The name of the NMTOKEN type

NMTOKEN_TYPE

public static final short NMTOKEN_TYPE
Field Value:
30

NON_NEGATIVE_INTEGER_NAME

public static final String NON_NEGATIVE_INTEGER_NAME
The name of the non-positive-integer type

NON_NEGATIVE_INTEGER_TYPE

public static final short NON_NEGATIVE_INTEGER_TYPE
Field Value:
39

NON_POSITIVE_INTEGER_NAME

public static final String NON_POSITIVE_INTEGER_NAME
The name of the non-positive-integer type

NON_POSITIVE_INTEGER_TYPE

public static final short NON_POSITIVE_INTEGER_TYPE
Field Value:
33

NORMALIZEDSTRING_NAME

public static final String NORMALIZEDSTRING_NAME
The name of the normalizedString type.

NORMALIZEDSTRING_TYPE

public static final short NORMALIZEDSTRING_TYPE
Field Value:
20

NOTATION_NAME

public static final String NOTATION_NAME
the name of the notation type

NOTATION_TYPE

public static final short NOTATION_TYPE
Field Value:
19

NULL

public static final short NULL
Field Value:
-1

POSITIVE_INTEGER_NAME

public static final String POSITIVE_INTEGER_NAME
The name of the positive-integer type

POSITIVE_INTEGER_TYPE

public static final short POSITIVE_INTEGER_TYPE
Field Value:
44

QNAME_NAME

public static final String QNAME_NAME
the name of the QName type

QNAME_TYPE

public static final short QNAME_TYPE
Field Value:
18

SHORT_NAME

public static final String SHORT_NAME
The name of the short type

SHORT_TYPE

public static final short SHORT_TYPE
Field Value:
37

STRING_NAME

public static final String STRING_NAME
The name of the string type

STRING_TYPE

public static final short STRING_TYPE
Field Value:
1

TIME_NAME

public static final String TIME_NAME
the name of the time type

TIME_TYPE

public static final short TIME_TYPE
Field Value:
4

TOKEN_NAME

public static final String TOKEN_NAME
The name of the token type

TOKEN_TYPE

public static final short TOKEN_TYPE
Field Value:
21

Constructor Details

XSType

protected XSType(short type)
Creates a new XSType of the given type

Method Details

createFromJavaObjectCode

public String createFromJavaObjectCode(String variableName)
Returns the String necessary to convert an Object to an instance of this XSType. This method is really only useful for primitive types
Parameters:
variableName - the name of the Object
Returns:
the String necessary to convert an Object to an instance of this XSType

createToJavaObjectCode

public String createToJavaObjectCode(String variableName)
Returns the String necessary to convert an instance of this XSType to an Object. This method is really only useful for primitive types
Parameters:
variableName - the name of the instance variable
Returns:
the String necessary to convert an instance of this XSType to an Object

escapePattern

protected static String escapePattern(String str)
Escapes special characters in the given String so that it can be printed correctly.
Parameters:
str - the String to escape
Returns:
the escaped String, or null if the given String was null.

getFacets

protected static Enumeration getFacets(SimpleType simpleType)
Returns a list of Facets from the simpleType (duplicate facets due to extension are filtered out)
Parameters:
Returns:
Unique list of facets from the simple type

getJType

public abstract JType getJType()
Returns the JType that this XSType represents
Returns:
the JType that this XSType represents

getName

public String getName()
Returns the name of this XSType
Returns:
the name of this XSType

getType

public short getType()
Returns the type of this XSType
Returns:
the type of this XSType

isDateTime

public boolean isDateTime()
Returns true if the XSType represents an XML Schema date/time type
Returns:
true if the XSType represents an XML Schema date/time type

isEnumerated

public boolean isEnumerated()
Returns true if this XSType represents an enumerated type
Returns:
true if this XSType represents an enumerated type

isPrimitive

public boolean isPrimitive()

newInstanceCode

public String newInstanceCode()
Returns the Java code neccessary to create a new instance of the JType associated with this XSType

setAsEnumertated

public void setAsEnumertated(boolean enumerated)
Sets the enumerated flag for this XSClass
Parameters:
enumerated - a boolean indicating whether or not this XSClass represents an enumerated type

setFacets

public abstract void setFacets(SimpleType simpleType)
Reads and sets the facets for XSType
Parameters:
simpleType - the SimpleType containing the facets

validationCode

public abstract void validationCode(JSourceCode jsc,
                                    String fixedValue,
                                    String fieldValidatorInstanceName)
Creates the validation code for an instance of this XSType. The validation code should if necessary create a newly configured TypeValidator, that should then be added to a FieldValidator instance whose name is provided.
Parameters:
jsc - the JSourceCode to fill in.
fixedValue - a fixed value to use if any
fieldValidatorInstanceName - the name of the FieldValidator that the configured TypeValidator should be added to.

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com