com.sun.xml.bind.v2.model.impl
Class RuntimeBuiltinLeafInfoImpl<T>

java.lang.Object
  extended by com.sun.xml.bind.v2.model.impl.BuiltinLeafInfoImpl<Type,Class>
      extended by com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl<T>
All Implemented Interfaces:
Locatable, com.sun.xml.bind.v2.model.core.BuiltinLeafInfo<Type,Class>, com.sun.xml.bind.v2.model.core.LeafInfo<Type,Class>, com.sun.xml.bind.v2.model.core.MaybeElement<Type,Class>, com.sun.xml.bind.v2.model.core.NonElement<Type,Class>, com.sun.xml.bind.v2.model.core.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 Transducers for the built-in types.

Author:
Kohsuke Kawaguchi

Field Summary
static List<RuntimeBuiltinLeafInfoImpl<?>> builtinBeanInfos
          List of all RuntimeBuiltinLeafInfoImpls.
static Map<Type,RuntimeBuiltinLeafInfoImpl<?>> LEAVES
          All instances of RuntimeBuiltinLeafInfoImpls keyed by their type.
static String MAP_ANYURI_TO_URI
           
static RuntimeBuiltinLeafInfoImpl<String> STRING
           
static String USE_OLD_GMONTH_MAPPING
           
 
Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement
ANYTYPE_NAME
 
Method Summary
 boolean canBeReferencedByIDREF()
          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 to w.
 Class getClazz()
          The same as TypeInfo.getType() but returns the type as a Class.
 Location getLocation()
           
 Transducer getTransducer()
          This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)
 TypeT getType()
          A reference to the representation of the type.
 QName getTypeName()
           
 QName getTypeName(T instance)
          Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.
 Locatable getUpstream()
           
 boolean isDefault()
          If this Transducer is the default transducer for the ValueT, this method returns true.
 boolean isSimpleType()
           
 String toString()
           
 boolean useNamespace()
          If true, this Transducer doesn't declare any namespace, and therefore Transducer.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.runtime.RuntimeLeafInfo
getTypeNames
 
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.core.TypeInfo
canBeReferencedByIDREF, getType
 
Methods inherited from interface com.sun.xml.bind.v2.model.annotation.Locatable
getLocation, getUpstream
 
Methods inherited from interface com.sun.xml.bind.v2.runtime.Transducer
parse, print, writeLeafElement, writeText
 

Field Detail

LEAVES

public static final Map<Type,RuntimeBuiltinLeafInfoImpl<?>> LEAVES
All instances of RuntimeBuiltinLeafInfoImpls keyed by their type.


STRING

public static final RuntimeBuiltinLeafInfoImpl<String> STRING

builtinBeanInfos

public static final List<RuntimeBuiltinLeafInfoImpl<?>> builtinBeanInfos
List of all RuntimeBuiltinLeafInfoImpls.

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

public static final String MAP_ANYURI_TO_URI
See Also:
Constant Field Values

USE_OLD_GMONTH_MAPPING

public static final String USE_OLD_GMONTH_MAPPING
See Also:
Constant Field Values
Method Detail

getClazz

public final Class getClazz()
Description copied from interface: RuntimeLeafInfo
The same as TypeInfo.getType() but returns the type as a Class.

Note that the returned Class object does not necessarily represents a class declaration. It can be primitive types.

Specified by:
getClazz in interface RuntimeLeafInfo

getTransducer

public final Transducer getTransducer()
Description copied from interface: RuntimeLeafInfo
This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)

Specified by:
getTransducer in interface RuntimeLeafInfo
Specified by:
getTransducer in interface RuntimeNonElement
Returns:
always non-null.
See Also:
RuntimeNonElementRef.getTransducer()

useNamespace

public boolean useNamespace()
Description copied from interface: Transducer
If true, this Transducer doesn't declare any namespace, and therefore Transducer.declareNamespace(Object, XMLSerializer) is no-op. It also means that the Transducer.parse(CharSequence) method won't use the context parameter.

Specified by:
useNamespace in interface Transducer<T>

isDefault

public final boolean isDefault()
Description copied from interface: Transducer
If this Transducer is the default transducer for the ValueT, this method returns true. Used exclusively by OptimizedTransducedAccessorFactory.get(RuntimePropertyInfo)

Specified by:
isDefault in interface Transducer<T>

declareNamespace

public void declareNamespace(T o,
                             XMLSerializer w)
                      throws AccessorException
Description copied from interface: Transducer
Declares the namespace URIs used in the given value to w.

Specified by:
declareNamespace in interface Transducer<T>
Parameters:
o - never be null.
w - may be null if !{@link #useNamespace()}.
Throws:
AccessorException

getTypeName

public QName getTypeName(T instance)
Description copied from interface: Transducer
Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.

Specified by:
getTypeName in interface Transducer<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

public TypeT getType()
A reference to the representation of the type.

Specified by:
getType in interface com.sun.xml.bind.v2.model.core.TypeInfo<TypeT,ClassDeclT>

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 interface com.sun.xml.bind.v2.model.core.TypeInfo<TypeT,ClassDeclT>

getTypeName

public QName getTypeName()
Specified by:
getTypeName in interface com.sun.xml.bind.v2.model.core.NonElement<TypeT,ClassDeclT>

getUpstream

public Locatable getUpstream()
Specified by:
getUpstream in interface Locatable

getLocation

public Location getLocation()
Specified by:
getLocation in interface Locatable

isSimpleType

public boolean isSimpleType()
Specified by:
isSimpleType in interface com.sun.xml.bind.v2.model.core.NonElement<TypeT,ClassDeclT>

toString

public String toString()
Specified by:
toString in interface Location
Overrides:
toString in class Object


Copyright © 2014 Oracle Corporation. All Rights Reserved.