- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.runtime.Coordinator
-
- All Implemented Interfaces:
jakarta.xml.bind.ValidationEventHandler,ErrorHandler
- Direct Known Subclasses:
UnmarshallingContext,XMLSerializer
public abstract class Coordinator extends Object implements ErrorHandler, jakarta.xml.bind.ValidationEventHandler
Object that coordinates the marshalling/unmarshalling.This class takes care of the logic that allows code to obtain
UnmarshallingContextandXMLSerializerinstances 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 sameCoordinatorcan be then used by a different thread for an entirely different episode.) This class also maintains the user-configured instances ofXmlAdapters.This class implements
ErrorHandlerand propages erros to this object as theValidationEventHandler, which will be implemented in a derived class.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description Coordinator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Coordinator_getInstance()<T extends jakarta.xml.bind.annotation.adapters.XmlAdapter>
booleancontainsAdapter(Class<T> type)voiderror(SAXParseException exception)voidfatalError(SAXParseException exception)<T extends jakarta.xml.bind.annotation.adapters.XmlAdapter>
TgetAdapter(Class<T> key)Gets the instance of the adapter.protected abstract jakarta.xml.bind.ValidationEventLocatorgetLocation()Gets the current location.protected voidpopCoordinator()Called whenever an execution flow exits the realm of thisCoordinator.protected voidpushCoordinator()Called whenever an execution flow enters the realm of thisCoordinator.jakarta.xml.bind.annotation.adapters.XmlAdapterputAdapter(Class<? extends jakarta.xml.bind.annotation.adapters.XmlAdapter> c, jakarta.xml.bind.annotation.adapters.XmlAdapter a)voidwarning(SAXParseException exception)
-
-
-
Method Detail
-
putAdapter
public final jakarta.xml.bind.annotation.adapters.XmlAdapter putAdapter(Class<? extends jakarta.xml.bind.annotation.adapters.XmlAdapter> c, jakarta.xml.bind.annotation.adapters.XmlAdapter a)
-
getAdapter
public final <T extends jakarta.xml.bind.annotation.adapters.XmlAdapter> T getAdapter(Class<T> key)
Gets the instance of the adapter.- Returns:
- always non-null.
-
containsAdapter
public <T extends jakarta.xml.bind.annotation.adapters.XmlAdapter> boolean containsAdapter(Class<T> type)
-
pushCoordinator
protected final void pushCoordinator()
Called whenever an execution flow enters the realm of thisCoordinator.
-
popCoordinator
protected final void popCoordinator()
Called whenever an execution flow exits the realm of thisCoordinator.
-
_getInstance
public static Coordinator _getInstance()
-
getLocation
protected abstract jakarta.xml.bind.ValidationEventLocator getLocation()
Gets the current location. Used for reporting the error source location.
-
error
public final void error(SAXParseException exception) throws SAXException
- Specified by:
errorin interfaceErrorHandler- Throws:
SAXException
-
warning
public final void warning(SAXParseException exception) throws SAXException
- Specified by:
warningin interfaceErrorHandler- Throws:
SAXException
-
fatalError
public final void fatalError(SAXParseException exception) throws SAXException
- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-
-