|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object
|
+--org.sapia.util.xml.confix.AbstractXMLProcessor
|
+--org.sapia.util.xml.confix.Dom4jProcessor
This class creates an object graph for a given XML input stream. It internally uses JDOM to transform the stream into a JDOM document, and then to create objects from the elements found in the document.
Usage:
ObjectFactoryIF fac = new ReflectionFactory("com.newtrade.company");
Dom4jProcessor proc = new Dom4jProcessor(fac);
Company comp = (Company)proc.process(new FileInputStream("d:/dev/company.xml"));
| Constructor Summary | |
|---|---|
Dom4jProcessor(ObjectFactoryIF anObjectFactory)
Creates a new JDOMProcessor instance with the argument passed in. |
|
| Method Summary | |
|---|---|
Object |
process(InputStream is)
This method takes an XML stream as input and returns an object representation of the passed-in XML. |
Object |
process(Object aParent,
org.dom4j.Element anElement)
This method will process the dom element passed in to create an object. |
void |
process(Object root,
InputStream is)
This method takes an object and assigns to it the object representation of the passed XML stream. |
| Methods inherited from class org.sapia.util.xml.confix.AbstractXMLProcessor |
|---|
assignToParent, containsMethod, convertChars, formatElementName, getObjectFactory, invokeMethod, invokeSetter, toMethodName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Dom4jProcessor(ObjectFactoryIF anObjectFactory)
anObjectFactory - The object factory of this processor.| Method Detail |
public Object process(InputStream is)
throws ProcessingException
is - an XML stream
ProcessingException
public void process(Object root,
InputStream is)
throws ProcessingException
root - an Object that is the root of the object graph to create
from the given XML.is - an XML InputStream.
ProcessingException - if an error occurs while processing the given XML stream.
public Object process(Object aParent,
org.dom4j.Element anElement)
throws ProcessingException
aParent - The parent object of the one to create.anElement - The dom element to process.
ProcessingException - If an error occurs while processing the dom tree.
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||