public class MarshallerFactory extends 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 Logger |
log
Class logger.
|
private Map<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(QName key)
Deregisters the marshaller for the given element.
|
Marshaller |
getMarshaller(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.
|
Map<QName,Marshaller> |
getMarshallers()
Gets an immutable listing of all the Marshallers currently registered.
|
void |
registerMarshaller(QName key,
Marshaller marshaller)
Registers a Marshaller with this factory.
|
private final Logger log
private final Map<QName,Marshaller> marshallers
@Nullable public Marshaller getMarshaller(@Nullable 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 Map<QName,Marshaller> getMarshallers()
public void registerMarshaller(@Nonnull QName key, @Nonnull Marshaller marshaller)
key - the key the marshaller was registered undermarshaller - the Marshaller@Nullable public Marshaller deregisterMarshaller(@Nonnull QName key)
key - the key the marshaller was registered underCopyright © 1999–2014. All rights reserved.