Class Coordinator
java.lang.Object
org.glassfish.jaxb.runtime.v2.runtime.Coordinator
- All Implemented Interfaces:
ValidationEventHandler,ErrorHandler
- Direct Known Subclasses:
UnmarshallingContext,XMLSerializer
Object that coordinates the marshalling/unmarshalling.
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 XmlAdapters.
This class implements ErrorHandler and propages erros to this object
as the ValidationEventHandler, which will be implemented in a derived class.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Coordinator<T extends XmlAdapter>
booleancontainsAdapter(Class<T> type) final voiderror(SAXParseException exception) final voidfatalError(SAXParseException exception) final <T extends XmlAdapter>
TgetAdapter(Class<T> key) Gets the instance of the adapter.protected abstract ValidationEventLocatorGets the current location.protected final voidCalled whenever an execution flow exits the realm of this .protected final voidCalled whenever an execution flow enters the realm of this .final XmlAdapterputAdapter(Class<? extends XmlAdapter> c, XmlAdapter a) final voidwarning(SAXParseException exception) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.xml.bind.ValidationEventHandler
handleEvent
-
Constructor Details
-
Coordinator
protected Coordinator()Default constructor.
-
-
Method Details
-
putAdapter
-
getAdapter
Gets the instance of the adapter.- Returns:
- always non-null.
-
containsAdapter
-
pushCoordinator
protected final void pushCoordinator()Called whenever an execution flow enters the realm of this . -
popCoordinator
protected final void popCoordinator()Called whenever an execution flow exits the realm of this . -
_getInstance
-
getLocation
Gets the current location. Used for reporting the error source location. -
error
- Specified by:
errorin interfaceErrorHandler- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceErrorHandler- Throws:
SAXException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-