|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface all object model providers must implement. Object model providers are used on marshalling providing data for XML content based on the object model and XML schema or DTD.
Each object model provider must implement one methodgetRoot
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:
Method Summary | |
Object |
getRoot(Object o,
String namespaceURI,
String localName)
Called by the framework when a root XML element is marshalled. |
Method Detail |
public Object getRoot(Object o, String namespaceURI, String localName)
o
- the root of the object graphnamespaceURI
- namespace URI of the root XML element being marshalledlocalName
- local name of the root XML element being marshalled
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |