|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.xb.binding.MetadataDrivenObjectModelFactory
public class MetadataDrivenObjectModelFactory
| Constructor Summary | |
|---|---|
MetadataDrivenObjectModelFactory()
|
|
| Method Summary | |
|---|---|
void |
addChild(Object parent,
Object child,
UnmarshallingContext ctx,
String namespaceURI,
String localName)
This method is called when parsing of a not top-level XML element completed. |
Object |
completeRoot(Object root,
UnmarshallingContext ctx,
String namespaceURI,
String localName)
This method is called by the framework when unmarshalling of the object graph completed. |
Object |
newChild(Object parent,
UnmarshallingContext ctx,
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 ctx,
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 ctx,
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 MetadataDrivenObjectModelFactory()
| Method Detail |
|---|
public Object newChild(Object parent,
UnmarshallingContext ctx,
String namespaceURI,
String localName,
Attributes attrs)
GenericObjectModelFactory
newChild in interface GenericObjectModelFactoryparent - an object that represents the parent XML element in the object modelctx - 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 ctx,
String namespaceURI,
String localName)
GenericObjectModelFactory
addChild in interface GenericObjectModelFactoryparent - 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 startedctx - unmarshalling contextnamespaceURI - namespace URI of the XML elementlocalName - local name of the XML element
public void setValue(Object o,
UnmarshallingContext ctx,
String namespaceURI,
String localName,
String value)
GenericObjectModelFactory
setValue in interface GenericObjectModelFactoryo - an object that represents the parent XML element in the Java object modelctx - 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 content
public Object newRoot(Object root,
UnmarshallingContext ctx,
String namespaceURI,
String localName,
Attributes attrs)
ObjectModelFactoryroot 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 ObjectModelFactoryroot - an object that is the root or which contains the root of the object graphctx - unmarshalling contextnamespaceURI - namespace URI of the rootlocalName - local name of the rootattrs - attributes of the root object
public Object completeRoot(Object root,
UnmarshallingContext ctx,
String namespaceURI,
String localName)
ObjectModelFactorynewRoot 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 ObjectModelFactoryroot - the object returned by newRoot at the beginning of unmarshallingctx - 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 | |||||||||