public class MarshallerFactory
extends java.lang.Object
Marshallers that can be used to convert
XMLObjects into W3C DOM elements. Marshallers are stored and retrieved by a
QName key. This key is either the XML Schema Type or element QName of the XML element the
XMLObject is marshalled into.| Modifier and Type | Field and Description |
|---|---|
private org.slf4j.Logger |
log
Class logger.
|
private java.util.Map<javax.xml.namespace.QName,Marshaller> |
marshallers
Map of marshallers to the elements they are for.
|
| Constructor and Description |
|---|
MarshallerFactory()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Marshaller |
deregisterMarshaller(javax.xml.namespace.QName key)
Deregisters the marshaller for the given element.
|
Marshaller |
getMarshaller(javax.xml.namespace.QName key)
Gets the Marshaller for a particular element or null if no marshaller is registered for an element.
|
Marshaller |
getMarshaller(XMLObject xmlObject)
Retrieves the marshaller for the given XMLObject.
|
java.util.Map<javax.xml.namespace.QName,Marshaller> |
getMarshallers()
Gets an immutable listing of all the Marshallers currently registered.
|
void |
registerMarshaller(javax.xml.namespace.QName key,
Marshaller marshaller)
Registers a Marshaller with this factory.
|
private final org.slf4j.Logger log
private final java.util.Map<javax.xml.namespace.QName,Marshaller> marshallers
@Nullable public Marshaller getMarshaller(@Nullable javax.xml.namespace.QName key)
key - the key the marshaller was registered under@Nullable public Marshaller getMarshaller(@Nonnull XMLObject xmlObject)
xmlObject - the XMLObject to retrieve the marshaller for@Nonnull public java.util.Map<javax.xml.namespace.QName,Marshaller> getMarshallers()
public void registerMarshaller(@Nonnull
javax.xml.namespace.QName key,
@Nonnull
Marshaller marshaller)
key - the key the marshaller was registered undermarshaller - the Marshaller@Nullable public Marshaller deregisterMarshaller(@Nonnull javax.xml.namespace.QName key)
key - the key the marshaller was registered under