public class TLcdXMLUnmarshallerProvider extends Object
ILcdXMLUnmarshaller
's that can unmarshal a specified XML element to instances
of a specified Java class.
This provider maintains a lookup table from each [XML element, Java class] pair to its
corresponding unmarshaller. If an unmarshaller is registered for a specified class, it will
automatically also be registered for all the ancestor classes and implemented interfaces of that
class.
One TLcdXMLUnmarshallerProvider
instance represents one set of unmarshallers which can
delegate to each other and which, all together, should be capable of unmarshalling instances of
one or more particular types of XML documents.
Please refer to the package documentation
for a general
overview of the XML Binding Framework.ILcdXMLUnmarshaller
,
TLcdXMLDecoder
Constructor and Description |
---|
TLcdXMLUnmarshallerProvider() |
Modifier and Type | Method and Description |
---|---|
<T> ILcdXMLUnmarshaller<? extends T> |
getUnmarshaller(QName aXMLGlobalElementName,
Class<T> aJavaClass)
Returns an unmarshaller which is capable of unmarshalling the specified XML element into an
instance of a Java class which is assignable to a field of the specified Java class.
|
<T> void |
registerUnmarshaller(QName aXMLElementName,
Class<T> aJavaClass,
ILcdXMLUnmarshaller<? extends T> aUnmarshaller)
Registers an
ILcdXMLUnmarshaller which is capable of unmarshalling the specified XML
element to the specified Java class. |
public <T> void registerUnmarshaller(QName aXMLElementName, Class<T> aJavaClass, ILcdXMLUnmarshaller<? extends T> aUnmarshaller)
ILcdXMLUnmarshaller
which is capable of unmarshalling the specified XML
element to the specified Java class.
The XML element name should be unique. Therefore, in the context of XML Schema, only
unmarshallers for global elements should be registered on this provider (local elements are not
guaranteed to be unique).aXMLElementName
- the XML element which the specified unmarshaller can read.aJavaClass
- the Java class to which the specified XML element is unmarshalled.aUnmarshaller
- the unmarshaller to be registered.NullPointerException
- if one of the arguments is null
.public <T> ILcdXMLUnmarshaller<? extends T> getUnmarshaller(QName aXMLGlobalElementName, Class<T> aJavaClass)
aXMLGlobalElementName
- the XML element which can be unmarshalled by the unmarshaller to
be returned.aJavaClass
- the Java class of the field to which the unmarshalled Java object
should be assignable.null
if no such unmarshaller was found.