com.sun.tools.xjc.model

Class CBuiltinLeafInfo

public abstract class CBuiltinLeafInfo extends BuiltinLeafInfoImpl<NType,NClass> implements CNonElement

Encapsulates the default handling for leaf classes (which are bound to text in XML.) In particular this class knows how to convert the lexical value into the Java class according to this default rule.

This represents the spec-defined default handling for the Java type (CBuiltinLeafInfo.

For those Java classes (such as String or Boolean) where the spec designates a specific default handling, there are constants in this class (such as STRING or BOOLEAN.)

The generated type-safe enum classes are also a leaf class, and as such there are CEnumLeafInfo that represents it as CBuiltinLeafInfo.

This class represents the default handling, and therefore we can only have one instance per one NType. Handling of other XML Schema types (such as xs:token) are represented as a general TypeUse objects.

Field Summary
static CBuiltinLeafInfoANYTYPE
static CBuiltinLeafInfoBASE64_BYTE_ARRAY
static CBuiltinLeafInfoBIG_DECIMAL
static CBuiltinLeafInfoBIG_INTEGER
static CBuiltinLeafInfoBOOLEAN
static TypeUseBOOLEAN_ZERO_OR_ONE
boolean restricted to 0 or 1.
static CBuiltinLeafInfoBYTE
static CBuiltinLeafInfoCALENDAR
static CBuiltinLeafInfoDATA_HANDLER
static CBuiltinLeafInfoDOUBLE
static CBuiltinLeafInfoDURATION
static CBuiltinLeafInfoFLOAT
static TypeUseHEXBIN_BYTE_ARRAY
static TypeUseID
static TypeUseIDREF
IDREF.
static CBuiltinLeafInfoIMAGE
static CBuiltinLeafInfoINT
static Map<NType,CBuiltinLeafInfo>LEAVES
All built-in leaves.
static CBuiltinLeafInfoLONG
static TypeUseNORMALIZED_STRING
static CBuiltinLeafInfoQNAME
static CBuiltinLeafInfoSHORT
static CBuiltinLeafInfoSTRING
static TypeUseSTRING_LIST
For all list of strings, such as NMTOKENS, ENTITIES.
static TypeUseTOKEN
static CBuiltinLeafInfoXML_SOURCE
Method Summary
CAdaptergetAdapterUse()
MimeTypegetExpectedMimeType()
CBuiltinLeafInfo never has a default associated MIME type.
CNonElementgetInfo()
Guaranteed to return this.
LocatorgetLocator()
XSComponentgetSchemaComponent()
IDidUse()
booleanisCollection()
Since CBuiltinLeafInfo represents a default binding, it is never a collection.
TypeUsemakeAdapted(Class<? extends XmlAdapter> adapter, boolean copy)
Creates a TypeUse that represents an adapted use of this CBuiltinLeafInfo.
TypeUsemakeCollection()
Creates a TypeUse that represents a collection of this CBuiltinLeafInfo.
TypeUsemakeMimeTyped(MimeType mt)
Creates a TypeUse that represents a MIME-type assocaited version of this CBuiltinLeafInfo.
JTypetoType(Outline o, Aspect aspect)
Gets the code model representation of this type.

Field Detail

ANYTYPE

public static final CBuiltinLeafInfo ANYTYPE

BASE64_BYTE_ARRAY

public static final CBuiltinLeafInfo BASE64_BYTE_ARRAY

BIG_DECIMAL

public static final CBuiltinLeafInfo BIG_DECIMAL

BIG_INTEGER

public static final CBuiltinLeafInfo BIG_INTEGER

BOOLEAN

public static final CBuiltinLeafInfo BOOLEAN

BOOLEAN_ZERO_OR_ONE

public static final TypeUse BOOLEAN_ZERO_OR_ONE
boolean restricted to 0 or 1.

BYTE

public static final CBuiltinLeafInfo BYTE

CALENDAR

public static final CBuiltinLeafInfo CALENDAR

DATA_HANDLER

public static final CBuiltinLeafInfo DATA_HANDLER

DOUBLE

public static final CBuiltinLeafInfo DOUBLE

DURATION

public static final CBuiltinLeafInfo DURATION

FLOAT

public static final CBuiltinLeafInfo FLOAT

HEXBIN_BYTE_ARRAY

public static final TypeUse HEXBIN_BYTE_ARRAY

ID

public static final TypeUse ID

IDREF

public static final TypeUse IDREF
IDREF. IDREF is has a whitespace normalization semantics of token, but we don't want XmlJavaTypeAdapter and XmlIDREF to interact.

IMAGE

public static final CBuiltinLeafInfo IMAGE

INT

public static final CBuiltinLeafInfo INT

LEAVES

public static final Map<NType,CBuiltinLeafInfo> LEAVES
All built-in leaves.

LONG

public static final CBuiltinLeafInfo LONG

NORMALIZED_STRING

public static final TypeUse NORMALIZED_STRING

QNAME

public static final CBuiltinLeafInfo QNAME

SHORT

public static final CBuiltinLeafInfo SHORT

STRING

public static final CBuiltinLeafInfo STRING

STRING_LIST

public static final TypeUse STRING_LIST
For all list of strings, such as NMTOKENS, ENTITIES.

TOKEN

public static final TypeUse TOKEN

XML_SOURCE

public static final CBuiltinLeafInfo XML_SOURCE

Method Detail

getAdapterUse

final CAdapter getAdapterUse()

getExpectedMimeType

public MimeType getExpectedMimeType()
CBuiltinLeafInfo never has a default associated MIME type.

getInfo

CNonElement getInfo()
Guaranteed to return this.

getLocator

public Locator getLocator()

getSchemaComponent

public final XSComponent getSchemaComponent()

idUse

public ID idUse()

isCollection

final boolean isCollection()
Since CBuiltinLeafInfo represents a default binding, it is never a collection.

makeAdapted

public final TypeUse makeAdapted(Class<? extends XmlAdapter> adapter, boolean copy)
Creates a TypeUse that represents an adapted use of this CBuiltinLeafInfo.

makeCollection

public final TypeUse makeCollection()
Creates a TypeUse that represents a collection of this CBuiltinLeafInfo.

makeMimeTyped

public final TypeUse makeMimeTyped(MimeType mt)
Creates a TypeUse that represents a MIME-type assocaited version of this CBuiltinLeafInfo.

toType

public JType toType(Outline o, Aspect aspect)
Gets the code model representation of this type.