public abstract static class Unmarshaller.Listener extends Object
Unmarshaller
to externally listen for unmarshal events. This class enables pre and post processing of an instance of a JAXB mapped class as XML data is unmarshalled into it. The event callbacks are called when unmarshalling XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition. The event callbacks are not called when unmarshalling to an instance of a Java datatype that represents a simple type definition. External listener is one of two different mechanisms for defining unmarshal event callbacks. See Unmarshal Event Callbacks for an overview. (@link #setListener(Listener)} (@link #getListener()}public Listener()
public void beforeUnmarshal(Object target, Object parent)
target
. This method is invoked immediately after target
was created and before the unmarshalling of this object begins. Note that if the class of target
defines its own beforeUnmarshal
method, the class specific callback method is invoked before this method is invoked.target
- non-null instance of JAXB mapped class prior to unmarshalling into it.parent
- instance of JAXB mapped class that will eventually reference target
. null
when target
is root element.public void afterUnmarshal(Object target, Object parent)
target
. This method is invoked after all the properties (except IDREF) are unmarshalled into target
, but before target
is set into its parent
object. Note that if the class of target
defines its own afterUnmarshal
method, the class specific callback method is invoked before this method is invoked.target
- non-null instance of JAXB mapped class prior to unmarshalling into it.parent
- instance of JAXB mapped class that will reference target
. null
when target
is root element.
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.