public interface ObjectModelProvider
getRoot
defined in ObjectModelProvider interface
and a set of getChildren, getElementValue and getAttributeValue methods descovered by the framework at runtime
with introspection.
So, the following methods should be implemented:
getRoot
method
java.lang.Object getRoot(java.lang.Object o, java.lang.String namespaceURI, java.lang.String localName)This method is called on the object model provider by the framework when a root XML element is marshalled. The method returns an object that represents the root of the XML content corresponding to the namespace URI and local name.
getChildren
methods
This method is called on the object model provider by the framework when marshalling of a new XML element started.
Each getChildren
method must have three arguments:
getChildren
method returns children that represent the namespace URI and local name in XML content.
The method can return null if there are no children in this object graph corresponding to the namespace and local name.
The method can return a single object if there is only one child object corresponding to the namespace and local name.
If there are many children that match the namespace URI and local name, the method can return them as an array,
java.util.List, java.util.Collection or java.util.Iterator.
getElementValue
methods
This method is called on the object model provider by the framework for objects that represent XML elements with
simple content, i.e. elements that don't contain nested XML elements.
The method must have three arguments:
getAttributeValue
methods
This method is called on the object model provider by the framework for objects that represent XML elements with
attributes.
The method must have three arguments:
Object getRoot(Object o, MarshallingContext ctx, String namespaceURI, String localName)
o
- the root of the object graphctx
- namespaceURI
- namespace URI of the root XML element being marshalledlocalName
- local name of the root XML element being marshalledCopyright © 2013 JBoss by Red Hat. All rights reserved.