|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.xb.binding.DelegatingObjectModelFactory
public class DelegatingObjectModelFactory
todo come up with a nicer class name
Constructor Summary | |
---|---|
DelegatingObjectModelFactory(ObjectModelFactory typedFactory)
|
Method Summary | |
---|---|
void |
addChild(Object parent,
Object child,
UnmarshallingContext navigator,
String namespaceURI,
String localName)
This method is called when parsing of a not top-level XML element completed. |
Object |
completeRoot(Object root,
UnmarshallingContext navigator,
String namespaceURI,
String localName)
This method is called by the framework when unmarshalling of the object graph completed. |
Object |
newChild(Object parent,
UnmarshallingContext navigator,
String namespaceURI,
String localName,
Attributes attrs)
This method is called when parsing of a new not top-level XML element started. |
Object |
newRoot(Object root,
UnmarshallingContext navigator,
String namespaceURI,
String localName,
Attributes attrs)
This method is called by the framework and returns the root of the object graph. |
void |
setValue(Object o,
UnmarshallingContext navigator,
String namespaceURI,
String localName,
String value)
This method is called when a new not top-level simple XML element (with text content) was parsed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelegatingObjectModelFactory(ObjectModelFactory typedFactory)
Method Detail |
---|
public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
ObjectModelFactory
root
argument is null, the factory is supposed to create and return a new one
that is going to be the real root object of the graph or an object that will represent the root object
during unmarshalling and which will be used to create the real root object when unmarshalling is complete
in completeRoot
if the real root object can't be created while its children are not available,
e.g. no no-arg constructor or other reasons.
If root
argument is not null (i.e. a user provided the root object through the
org.jboss.xml.binding.Unmarshaller
) then the factory could just return it as is or
extract the real root from the root
argument based on the namespace URI and local name
if root
argument wraps/contains the real root.
newRoot
in interface ObjectModelFactory
root
- an object that is the root or which contains the root of the object graphnavigator
- unmarshalling contextnamespaceURI
- namespace URI of the rootlocalName
- local name of the rootattrs
- attributes of the root object
public Object newChild(Object parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
GenericObjectModelFactory
newChild
in interface GenericObjectModelFactory
parent
- an object that represents the parent XML element in the object modelnavigator
- unmarshalling contextnamespaceURI
- namespace URI of the XML elementlocalName
- local name of the XML elementattrs
- attributes of the XML element
public void addChild(Object parent, Object child, UnmarshallingContext navigator, String namespaceURI, String localName)
GenericObjectModelFactory
addChild
in interface GenericObjectModelFactory
parent
- an object that represents the parent XML element in the object modelchild
- an object that was returned by the newChild
method that
was called when parsing of this XML element startednavigator
- unmarshalling contextnamespaceURI
- namespace URI of the XML elementlocalName
- local name of the XML elementpublic void setValue(Object o, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
GenericObjectModelFactory
setValue
in interface GenericObjectModelFactory
o
- an object that represents the parent XML element in the Java object modelnavigator
- unmarshalling contextnamespaceURI
- namespace URI of the XML elementlocalName
- local name of the XML elementvalue
- value of the XML element as it appears in the XML contentpublic Object completeRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName)
ObjectModelFactory
newRoot
returned not the real root object but an
object that represented the root during unmarshalling, the real root object should be created
and returned.
completeRoot
in interface ObjectModelFactory
root
- the object returned by newRoot
at the beginning of unmarshallingnavigator
- unmarshalling contextnamespaceURI
- namespace URI that corresponds to the rootlocalName
- local element name the root of the object graph is bound to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |