org.jboss.xml.binding
Interface ObjectModelFactory

All Known Subinterfaces:
GenericObjectModelFactory (src)
All Known Implementing Classes:
BookGenericObjectModelFactory (src) , BookObjectFactory (src) , ConfigInfoBinding (src) , DelegatingObjectModelFactory (src) , JavaWsdlMappingFactory (src) , JDBCPmMetaDataFactory (src) , LoginConfigObjectModelFactory (src) , MappingObjectModelFactory (src) , ResourceAdapterObjectModelFactory (src) , SchemalessObjectModelFactory (src) , UsersObjectModelFactory (src) , WebservicesFactory (src) , XMBeanMetaDataFactory (src)

public interface ObjectModelFactory

The interface all object model factories must implement. Object model factories are used on unmarshalling to build the object graph.

Each object model factory must implement one method newRoot defined in the ObjectModelFactory interface and a set of newChild, addChild and setValue methods descovered by the framework at runtime with introspection. So the following methods should be implemented:


Method Summary
 java.lang.Object newRoot(java.lang.Object root, ContentNavigator (src)  navigator, java.lang.String namespaceURI, java.lang.String localName, org.xml.sax.Attributes attrs)
          This method is called by the object model factory and returns the root of the object graph.
 

Method Detail

newRoot

public java.lang.Object newRoot(java.lang.Object root,
                                ContentNavigator (src)  navigator,
                                java.lang.String namespaceURI,
                                java.lang.String localName,
                                org.xml.sax.Attributes attrs)
This method is called by the object model factory and returns the root of the object graph. If the root argument is null the factory is supposed to create and return a new one. If the root argument is not null (i.e. the user provided the root object through the org.jboss.xml.binding.Unmarshaller) then the factory should either just return it as is or extract the real root from the root argument based on the namespace URI and local name.

Parameters:
root - an object that is the root or which contains the root object
navigator - content navigator
namespaceURI - namespace URI of the root
localName - local name of the root
attrs - attributes of the root object
Returns:
the root of the object graph