public abstract class Coordinator extends Object implements ErrorHandler, ValidationEventHandler
This class takes care of the logic that allows code to obtain
UnmarshallingContext
and XMLSerializer
instances
during the unmarshalling/marshalling.
This is done by using a ThreadLocal
. Therefore one unmarshalling/marshalling
episode has to be done from the beginning till end by the same thread.
(Note that the same Coordinator
can be then used by a different thread
for an entirely different episode.)
This class also maintains the user-configured instances of XmlAdapter
s.
This class implements ErrorHandler
and propages erros to this object
as the ValidationEventHandler
, which will be implemented in a derived class.
Constructor and Description |
---|
Coordinator() |
Modifier and Type | Method and Description |
---|---|
static Coordinator |
_getInstance() |
<T extends XmlAdapter> |
containsAdapter(Class<T> type) |
void |
error(SAXParseException exception) |
void |
fatalError(SAXParseException exception) |
<T extends XmlAdapter> |
getAdapter(Class<T> key)
Gets the instance of the adapter.
|
protected abstract ValidationEventLocator |
getLocation()
Gets the current location.
|
protected void |
popCoordinator()
Called whenever an execution flow exits the realm of this
Coordinator . |
protected void |
pushCoordinator()
Called whenever an execution flow enters the realm of this
Coordinator . |
XmlAdapter |
putAdapter(Class<? extends XmlAdapter> c,
XmlAdapter a) |
void |
warning(SAXParseException exception) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleEvent
public final XmlAdapter putAdapter(Class<? extends XmlAdapter> c, XmlAdapter a)
public final <T extends XmlAdapter> T getAdapter(Class<T> key)
public <T extends XmlAdapter> boolean containsAdapter(Class<T> type)
protected final void pushCoordinator()
Coordinator
.protected final void popCoordinator()
Coordinator
.public static Coordinator _getInstance()
protected abstract ValidationEventLocator getLocation()
public final void error(SAXParseException exception) throws SAXException
error
in interface ErrorHandler
SAXException
public final void warning(SAXParseException exception) throws SAXException
warning
in interface ErrorHandler
SAXException
public final void fatalError(SAXParseException exception) throws SAXException
fatalError
in interface ErrorHandler
SAXException
Copyright © 2018 JBoss by Red Hat. All rights reserved.