Class CBuiltinLeafInfo
- All Implemented Interfaces:
CCustomizable
,CNonElement
,CTypeInfo
,TypeUse
,Locatable
,BuiltinLeafInfo<NType,
,NClass> LeafInfo<NType,
,NClass> MaybeElement<NType,
,NClass> NonElement<NType,
,NClass> TypeInfo<NType,
,NClass> Location
This represents the spec-defined default handling for the Java
type (getType()
.
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.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final TypeUse
boolean restricted to 0 or 1.static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final TypeUse
static final TypeUse
static final TypeUse
IDREF.static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final Map<NType,
CBuiltinLeafInfo> All built-in leaves.static final CBuiltinLeafInfo
static final TypeUse
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final CBuiltinLeafInfo
static final TypeUse
For all list of strings, such as NMTOKENS, ENTITIES.static final TypeUse
static final CBuiltinLeafInfo
Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement
ANYTYPE_NAME
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.always return null at this level.final boolean
Deprecated.why are you calling a method whose return value is always known?final CAdapter
Deprecated.final QName
Deprecated.always return null at this level.CBuiltinLeafInfo
never has a default associated MIME type.getInfo()
Deprecated.Gets the location object that this object points to.Gets the source location in the schema from which this model component is created.final XSComponent
If this model object is built from XML Schema, this property returns a schema component from which the model is built.getType()
A reference to the representation of the type.Gets the primary XML type ANYTYPE_NAME of the class.final QName[]
Returns all the type names recognized by this bean info.Gets the upstreamLocation
information.idUse()
Whether the referenced type (individual item type in case of collection) is ID/IDREF.final boolean
Deprecated.final boolean
Deprecated.always return false at this level.boolean
Returns true if thisNonElement
maps to text in XML, without any attribute nor child elements.final TypeUse
makeAdapted
(Class<? extends XmlAdapter> adapter, boolean copy) Creates aTypeUse
that represents an adapted use of thisCBuiltinLeafInfo
.final TypeUse
Creates aTypeUse
that represents a collection of thisCBuiltinLeafInfo
.final TypeUse
Creates aTypeUse
that represents a MIME-type assocaited version of thisCBuiltinLeafInfo
.Gets the code model representation of this type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sun.tools.xjc.model.CCustomizable
getCustomizations
Methods inherited from interface com.sun.tools.xjc.model.TypeUse
createConstant
-
Field Details
-
LEAVES
All built-in leaves. -
ANYTYPE
-
STRING
-
BOOLEAN
-
INT
-
LONG
-
BYTE
-
SHORT
-
FLOAT
-
DOUBLE
-
QNAME
-
CALENDAR
-
DURATION
-
BIG_INTEGER
-
BIG_DECIMAL
-
BASE64_BYTE_ARRAY
-
DATA_HANDLER
-
IMAGE
-
XML_SOURCE
-
HEXBIN_BYTE_ARRAY
-
TOKEN
-
NORMALIZED_STRING
-
ID
-
BOOLEAN_ZERO_OR_ONE
boolean restricted to 0 or 1. -
IDREF
IDREF. IDREF is has a whitespace normalization semantics of token, but we don't wantXmlJavaTypeAdapter
andXmlIDREF
to interact. -
STRING_LIST
For all list of strings, such as NMTOKENS, ENTITIES.
-
-
Method Details
-
toType
Gets the code model representation of this type. -
isCollection
Deprecated.SinceCBuiltinLeafInfo
represents a default binding, it is never a collection.- Specified by:
isCollection
in interfaceCNonElement
- Specified by:
isCollection
in interfaceTypeUse
-
getInfo
Deprecated.Guaranteed to return this.- Specified by:
getInfo
in interfaceCNonElement
- Specified by:
getInfo
in interfaceTypeUse
-
idUse
Description copied from interface:TypeUse
Whether the referenced type (individual item type in case of collection) is ID/IDREF.ID is a property of a relationship. When a bean Foo has an ID property called 'bar' whose type is String, Foo isn't an ID, String isn't an ID, but this relationship is an ID (in the sense that Foo uses this String as an ID.)
The same thing can be said with IDREF. When Foo refers to Bar by means of IDREF, neither Foo nor Bar is IDREF.
That's why we have this method in
TypeUse
. -
getExpectedMimeType
CBuiltinLeafInfo
never has a default associated MIME type.- Specified by:
getExpectedMimeType
in interfaceTypeUse
-
getAdapterUse
Deprecated.Description copied from interface:CNonElement
Guaranteed to return null.- Specified by:
getAdapterUse
in interfaceCNonElement
- Specified by:
getAdapterUse
in interfaceTypeUse
-
getLocator
Description copied from interface:CCustomizable
Gets the source location in the schema from which this model component is created.- Specified by:
getLocator
in interfaceCCustomizable
- Returns:
- never null.
-
getSchemaComponent
Description copied from interface:CCustomizable
If this model object is built from XML Schema, this property returns a schema component from which the model is built.- Specified by:
getSchemaComponent
in interfaceCCustomizable
- Returns:
- null if the model is built from sources other than XML Schema (such as DTD.)
-
makeCollection
Creates aTypeUse
that represents a collection of thisCBuiltinLeafInfo
. -
makeAdapted
Creates aTypeUse
that represents an adapted use of thisCBuiltinLeafInfo
. -
makeMimeTyped
Creates aTypeUse
that represents a MIME-type assocaited version of thisCBuiltinLeafInfo
. -
isElement
public final boolean isElement()Deprecated.always return false at this level.Description copied from interface:MaybeElement
If the class is bound to an element, return true.Note that when this is true, the class is bound to both an element and a type.
- Specified by:
isElement
in interfaceMaybeElement<NType,
NClass>
-
getElementName
Deprecated.always return null at this level.Description copied from interface:MaybeElement
Gets the element name of the class, if the class is bound to an element.- Specified by:
getElementName
in interfaceMaybeElement<NType,
NClass> - Returns:
- non-null iff
MaybeElement.isElement()
.
-
asElement
Deprecated.always return null at this level.Description copied from interface:MaybeElement
- Specified by:
asElement
in interfaceMaybeElement<NType,
NClass> - Returns:
- null if
MaybeElement.isElement()
==false, non-null ifMaybeElement.isElement()
==true.
-
getType
A reference to the representation of the type. -
getTypeNames
Returns all the type names recognized by this bean info.- Returns:
- do not modify the returned array.
-
canBeReferencedByIDREF
public final boolean canBeReferencedByIDREF()Deprecated.why are you calling a method whose return value is always known?Leaf-type cannot be referenced from IDREF.- Specified by:
canBeReferencedByIDREF
in interfaceTypeInfo<NType,
NClass>
-
getTypeName
Description copied from interface:NonElement
Gets the primary XML type ANYTYPE_NAME of the class.A Java type can be mapped to multiple XML types, but one of them is considered "primary" and used when we generate a schema.
- Specified by:
getTypeName
in interfaceBuiltinLeafInfo<NType,
NClass> - Specified by:
getTypeName
in interfaceNonElement<NType,
NClass> - Returns:
- null if the object doesn't have an explicit type ANYTYPE_NAME (AKA anonymous.)
-
getUpstream
Description copied from interface:Locatable
Gets the upstreamLocation
information.- Specified by:
getUpstream
in interfaceLocatable
- Returns:
- can be null.
-
getLocation
Description copied from interface:Locatable
Gets the location object that this object points to. This operation could be inefficient and costly.- Specified by:
getLocation
in interfaceLocatable
-
isSimpleType
public boolean isSimpleType()Description copied from interface:NonElement
Returns true if thisNonElement
maps to text in XML, without any attribute nor child elements.- Specified by:
isSimpleType
in interfaceNonElement<NType,
NClass>
-