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()}Constructor and Description |
---|
Listener() |
Modifier and Type | Method and Description |
---|---|
void |
afterUnmarshal(Object target,
Object parent)
Callback method invoked after unmarshalling XML data into target.
|
void |
beforeUnmarshal(Object target,
Object parent)
Callback method invoked before unmarshalling into target.
|
public void beforeUnmarshal(Object target, Object parent)
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
- 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. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.