Package com.luciad.format.xml.bind
Class TLcdXMLObjectFactoryProvider
java.lang.Object
com.luciad.format.xml.bind.TLcdXMLObjectFactoryProvider
Provider of
ILcdXMLObjectFactory
's that can create a Java object for a specified
XML element.
This provider maintains a lookup table from each [XML element, Java class] pair to its
corresponding object factory. If an object factory is registered for a specified class, it will
automatically also be registered for all the ancestor classes and implemented interfaces of that
class.
Please refer to the package documentation
for a general
overview of the XML Binding Framework.- Since:
- 9.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> ILcdXMLObjectFactory
<T> getObjectFactory
(QName aXMLElementName, Class<T> aJavaClass) Returns an object factory which is capable of creating instances of the specified Java class for the specified XML element name.<T> void
registerObjectFactory
(QName aXMLElementName, Class<T> aJavaClass, ILcdXMLObjectFactory<? extends T> aFactory) Registers anILcdXMLObjectFactory
which is capable of creating instances of the specified Java class for the specified XML element.
-
Constructor Details
-
TLcdXMLObjectFactoryProvider
public TLcdXMLObjectFactoryProvider()
-
-
Method Details
-
registerObjectFactory
public <T> void registerObjectFactory(QName aXMLElementName, Class<T> aJavaClass, ILcdXMLObjectFactory<? extends T> aFactory) Registers anILcdXMLObjectFactory
which is capable of creating instances of the specified Java class for the specified XML element.- Parameters:
aXMLElementName
- the XML element that corresponds to the instances that are to be createdaJavaClass
- the Java class of which instances should be createdaFactory
- the factory to be registered.- Throws:
NullPointerException
- if one of the arguments isnull
.
-
getObjectFactory
Returns an object factory which is capable of creating instances of the specified Java class for the specified XML element name.- Parameters:
aXMLElementName
- the XML element that corresponds to the instances that are to be createdaJavaClass
- the Java class to which the object created by the resulting factory should be assignable- Returns:
- an object factory for creating instances of the
specified Java class for the specified XML element name,
or
null
if no such factory was found.
-