Class TLcdXMLSchemaBasedUnmarshallerProvider
java.lang.Object
com.luciad.format.xml.bind.TLcdXMLUnmarshallerProvider
com.luciad.format.xml.bind.schema.TLcdXMLSchemaBasedUnmarshallerProvider
Extended
TLcdXMLUnmarshallerProvider
that also allows unmarshallers to be
registered
and retrieved for local elements.-
Constructor Summary
ConstructorDescriptionCreates a new instance for the given decoder. -
Method Summary
Modifier and TypeMethodDescription<T> ILcdXMLUnmarshaller
<? extends T> getUnmarshaller
(TLcdXMLSchemaElementIdentifier aElementId, Class<T> aClass) Gets an unmarshaller for the given element and class.<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
(TLcdXMLSchemaElementIdentifier aElementId, Class<T> aJavaClass, ILcdXMLUnmarshaller<? extends T> aMarshaller) Registers the unmarshaller for the given element and java class.Methods inherited from class com.luciad.format.xml.bind.TLcdXMLUnmarshallerProvider
registerUnmarshaller
-
Constructor Details
-
TLcdXMLSchemaBasedUnmarshallerProvider
Creates a new instance for the given decoder.- Parameters:
aDecoder
- the decoder for which to create a new instance
-
-
Method Details
-
getUnmarshaller
public <T> ILcdXMLUnmarshaller<? extends T> getUnmarshaller(TLcdXMLSchemaElementIdentifier aElementId, Class<T> aClass) Gets an unmarshaller for the given element and class. This method is typically used for elements for which no substitution is possible. If no unmarshaller is registered for the given element and class, returns an adapter around the corresponding type unmarshaller.- Parameters:
aElementId
- the identifier of the element that the unmarshaller should be able to unmarshalaClass
- the class of which instances should be returned by the unmarshaller- Returns:
- an unmarshaller for the given element and class
-
registerUnmarshaller
public <T> void registerUnmarshaller(TLcdXMLSchemaElementIdentifier aElementId, Class<T> aJavaClass, ILcdXMLUnmarshaller<? extends T> aMarshaller) Registers the unmarshaller for the given element and java class.- Parameters:
aElementId
- the identifier of the element for which the unmarshaller is to be registeredaJavaClass
- the class of which instances are unmarshalledaMarshaller
- the unmarshaller for the given element identifier and class
-
getUnmarshaller
public <T> ILcdXMLUnmarshaller<? extends T> getUnmarshaller(QName aXMLGlobalElementName, Class<T> aJavaClass) Description copied from class:TLcdXMLUnmarshallerProvider
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.- Overrides:
getUnmarshaller
in classTLcdXMLUnmarshallerProvider
- Parameters:
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.- Returns:
- an unmarshaller for unmarshalling the specified XML element to an instance of the
specified Java class, or
null
if no such unmarshaller was found.
-