Package com.sun.xml.bind.v2.model.impl
Class RuntimeBuiltinLeafInfoImpl<T>
java.lang.Object
com.sun.xml.bind.v2.model.impl.BuiltinLeafInfoImpl<Type,Class>
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl<T>
- All Implemented Interfaces:
Locatable
,BuiltinLeafInfo<Type,
,Class> LeafInfo<Type,
,Class> MaybeElement<Type,
,Class> NonElement<Type,
,Class> TypeInfo<Type,
,Class> RuntimeBuiltinLeafInfo
,RuntimeLeafInfo
,RuntimeNonElement
,RuntimeTypeInfo
,Location
,Transducer<T>
public abstract class RuntimeBuiltinLeafInfoImpl<T>
extends BuiltinLeafInfoImpl<Type,Class>
implements RuntimeBuiltinLeafInfo, Transducer<T>
BuiltinLeafInfoImpl
with a support for runtime.
In particular this class defines Transducer
s for the built-in types.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List
<RuntimeBuiltinLeafInfoImpl<?>> List of allRuntimeBuiltinLeafInfoImpl
s.static final Map
<Type, RuntimeBuiltinLeafInfoImpl<?>> All instances ofRuntimeBuiltinLeafInfoImpl
s keyed by their type.static final String
static final RuntimeBuiltinLeafInfoImpl
<String> static final String
Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement
ANYTYPE_NAME
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Deprecated.why are you calling a method whose return value is always known?void
declareNamespace
(T o, XMLSerializer w) Declares the namespace URIs used in the given value tow
.final Class
getClazz()
The same asTypeInfo.getType()
but returns the type as aClass
.Gets the location object that this object points to.final Transducer
This method doesn't take the reference properties defined onRuntimeNonElementRef
into account (such as ID-ness.)getType()
A reference to the representation of the type.Gets the primary XML type ANYTYPE_NAME of the class.getTypeName
(T instance) Transducers implicitly work against a single XML type, but sometimes (most notablyXMLGregorianCalendar
, an instance may choose different XML types.Gets the upstreamLocation
information.boolean
Returns true if thisNonElement
maps to text in XML, without any attribute nor child elements.toString()
Returns a human-readable string that represents this position.boolean
If true, thisTransducer
doesn't declare any namespace, and thereforeTransducer.declareNamespace(Object, XMLSerializer)
is no-op.Methods inherited from class com.sun.xml.bind.v2.model.impl.BuiltinLeafInfoImpl
asElement, createLeaves, getElementName, getTypeNames, isElement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sun.xml.bind.v2.model.core.BuiltinLeafInfo
getTypeName
Methods inherited from interface com.sun.xml.bind.v2.model.annotation.Locatable
getLocation, getUpstream
Methods inherited from interface com.sun.xml.bind.v2.model.core.MaybeElement
asElement, getElementName, isElement
Methods inherited from interface com.sun.xml.bind.v2.model.core.NonElement
isSimpleType
Methods inherited from interface com.sun.xml.bind.v2.model.runtime.RuntimeLeafInfo
getTypeNames
Methods inherited from interface com.sun.xml.bind.v2.runtime.Transducer
parse, print, writeLeafElement, writeText
Methods inherited from interface com.sun.xml.bind.v2.model.core.TypeInfo
canBeReferencedByIDREF, getType
-
Field Details
-
LEAVES
All instances ofRuntimeBuiltinLeafInfoImpl
s keyed by their type. -
STRING
-
builtinBeanInfos
List of allRuntimeBuiltinLeafInfoImpl
s.This corresponds to the built-in Java classes that are specified to be handled differently than ordinary classes. See table 8-2 "Mapping of Standard Java classes".
-
MAP_ANYURI_TO_URI
- See Also:
-
USE_OLD_GMONTH_MAPPING
- See Also:
-
-
Method Details
-
getClazz
Description copied from interface:RuntimeLeafInfo
The same asTypeInfo.getType()
but returns the type as aClass
.Note that the returned
Class
object does not necessarily represents a class declaration. It can be primitive types.- Specified by:
getClazz
in interfaceRuntimeLeafInfo
-
getTransducer
Description copied from interface:RuntimeLeafInfo
This method doesn't take the reference properties defined onRuntimeNonElementRef
into account (such as ID-ness.)- Specified by:
getTransducer
in interfaceRuntimeLeafInfo
- Specified by:
getTransducer
in interfaceRuntimeNonElement
- Returns:
- always non-null.
- See Also:
-
useNamespace
public boolean useNamespace()Description copied from interface:Transducer
If true, thisTransducer
doesn't declare any namespace, and thereforeTransducer.declareNamespace(Object, XMLSerializer)
is no-op. It also means that theTransducer.parse(CharSequence)
method won't use the context parameter.- Specified by:
useNamespace
in interfaceTransducer<T>
-
declareNamespace
Description copied from interface:Transducer
Declares the namespace URIs used in the given value tow
.- Specified by:
declareNamespace
in interfaceTransducer<T>
- Parameters:
o
- never be null.w
- may be null if!{@link #useNamespace()}
.- Throws:
AccessorException
-
getTypeName
Description copied from interface:Transducer
Transducers implicitly work against a single XML type, but sometimes (most notablyXMLGregorianCalendar
, an instance may choose different XML types.- Specified by:
getTypeName
in interfaceTransducer<T>
- Returns:
- return non-null from this method allows transducers to specify the type it wants to marshal to. Most of the time this method returns null, in which case the implicitly associated type will be used.
-
getType
A reference to the representation of the type. -
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<TypeT,
ClassDeclT>
-
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 interfaceNonElement<TypeT,
ClassDeclT> - 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<TypeT,
ClassDeclT>
-
toString
Description copied from interface:Location
Returns a human-readable string that represents this position.
-