Class Unmarshaller.Listener
- java.lang.Object
-
- javax.xml.bind.Unmarshaller.Listener
-
- Enclosing interface:
- Unmarshaller
public abstract static class Unmarshaller.Listener extends java.lang.ObjectRegister an instance of an implementation of this class with
Unmarshallerto 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()}- Since:
- 1.6, JAXB 2.0
-
-
Constructor Summary
Constructors Constructor Description Listener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterUnmarshal(java.lang.Object target, java.lang.Object parent)Callback method invoked after unmarshalling XML data intotarget.voidbeforeUnmarshal(java.lang.Object target, java.lang.Object parent)Callback method invoked before unmarshalling intotarget.
-
-
-
Method Detail
-
beforeUnmarshal
public void beforeUnmarshal(java.lang.Object target, java.lang.Object parent)Callback method invoked before unmarshalling into
target.This method is invoked immediately after
targetwas created and before the unmarshalling of this object begins. Note that if the class oftargetdefines its ownbeforeUnmarshalmethod, the class specific callback method is invoked before this method is invoked.- Parameters:
target- non-null instance of JAXB mapped class prior to unmarshalling into it.parent- instance of JAXB mapped class that will eventually referencetarget.nullwhentargetis root element.
-
afterUnmarshal
public void afterUnmarshal(java.lang.Object target, java.lang.Object parent)Callback method invoked after unmarshalling XML data into
target.This method is invoked after all the properties (except IDREF) are unmarshalled into
target, but beforetargetis set into itsparentobject. Note that if the class oftargetdefines its ownafterUnmarshalmethod, the class specific callback method is invoked before this method is invoked.- Parameters:
target- non-null instance of JAXB mapped class prior to unmarshalling into it.parent- instance of JAXB mapped class that will referencetarget.nullwhentargetis root element.
-
-