- java.lang.Object
-
- javax.xml.bind.Marshaller.Listener
-
- Enclosing interface:
- Marshaller
public abstract static class Marshaller.Listener extends Object
Register an instance of an implementation of this class with aMarshaller
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.- Since:
- JAXB2.0
- See Also:
Marshaller.setListener(Listener)
,Marshaller.getListener()
-
-
Constructor Summary
Constructors Constructor and Description Marshaller.Listener()
-
Method Summary
Methods Modifier and Type Method and Description void
afterMarshal(Object source)
Callback method invoked after marshalling source to XML.void
beforeMarshal(Object source)
Callback method invoked before marshalling from source to XML.
-
-
-
Method Detail
-
beforeMarshal
public void beforeMarshal(Object source)
Callback method invoked before marshalling from 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.- Parameters:
source
- instance of JAXB mapped class prior to marshalling from it.
-
afterMarshal
public void afterMarshal(Object source)
Callback method invoked after marshalling 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.- Parameters:
source
- instance of JAXB mapped class after marshalling it.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/xml/bind/Marshaller.Listener.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.