public abstract static class Marshaller.Listener extends Object
Marshaller
to externally listen for marshal events. This class enables pre and post processing of each marshalled object. The event callbacks are called when marshalling from an instance that maps to an xml element or complex type definition. The event callbacks are not called when marshalling from an instance of a Java datatype that represents a simple type definition. External listener is one of two different mechanisms for defining marshal event callbacks. See Marshal Event Callbacks for an overview.Marshaller.setListener(Listener)
, Marshaller.getListener()
public Listener()
public void beforeMarshal(Object source)
source
to XML. This method is invoked just before marshalling process starts to marshal source
. Note that if the class of source
defines its own beforeMarshal
method, the class specific callback method is invoked just before this method is invoked.source
- instance of JAXB mapped class prior to marshalling from it.public void afterMarshal(Object source)
source
to XML. This method is invoked after source
and all its descendants have been marshalled. Note that if the class of source
defines its own afterMarshal
method, the class specific callback method is invoked just before this method is invoked.source
- instance of JAXB mapped class after marshalling it.
© 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.