* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
Each object model provider must implement one method
getRoot defined in ObjectModelProvider interface
and a set of getChildren, getElementValue and getAttributeValue methods descovered by the framework at runtime
So, the following methods should be implemented:
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.
getChildrenmethods This method is called on the object model provider by the framework when marshalling of a new XML element started. Each
getChildrenmethod must have three arguments:
getChildrenmethod 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.
getElementValuemethods 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:
getAttributeValuemethods 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:
othe root of the object graph
namespaceURInamespace URI of the root XML element being marshalled
localNamelocal name of the root XML element being marshalled