|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.milyn.javabean.binding.AbstractBinding
org.milyn.javabean.binding.xml.XMLBinding
public class XMLBinding
XML Binding class.
This class is designed specifically for reading and writing XML data (does not work for other data formats) to and from Java Object models using nothing more than standard <jb:bean> configurations i.e. no need to write a template for serializing the Java Objects to an output character based format, as with Smooks v1.4 and before.
| Constructor Summary | |
|---|---|
XMLBinding()
Public constructor. |
|
XMLBinding(org.milyn.Smooks smooks)
Public constructor. |
|
| Method Summary | ||
|---|---|---|
XMLBinding |
add(InputStream smooksConfigStream)
Add Smooks binding configurations to the binding instance. |
|
XMLBinding |
add(String smooksConfigURI)
Add Smooks binding configurations to the binding instance. |
|
|
fromXML(Source inputSource,
Class<T> toType)
Bind from the XML into the Java Object model. |
|
|
fromXML(String inputSource,
Class<T> toType)
Bind from the XML into the Java Object model. |
|
XMLBinding |
intiailize()
Initialize the binding instance. |
|
XMLBinding |
setOmitXMLDeclaration(boolean omitXMLDeclaration)
Turn on/off outputting of the XML declaration when executing the toXML(Object, java.io.Writer) method. |
|
XMLBinding |
setReportPath(String reportPath)
Set the execution report output path. |
|
String |
toXML(Object object)
Write the supplied Object instance to XML. |
|
|
toXML(Object object,
W outputWriter)
Write the supplied Object instance to XML. |
|
| Methods inherited from class org.milyn.javabean.binding.AbstractBinding |
|---|
assertInitialized, assertNotAllConfigsAdded, assertNotInitialized, bind, constructContextualGetter, constructContextualGetter, getSmooks, getUserDefinedResourceList |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLBinding()
add(java.io.InputStream) (or add(String)) method
and then the intiailize() method.
public XMLBinding(org.milyn.Smooks smooks)
smooks - The pre-configured Smooks instance.| Method Detail |
|---|
public XMLBinding add(String smooksConfigURI)
throws IOException,
SAXException
AbstractBinding
add in class AbstractBindingsmooksConfigURI - Smooks configuration.
IOException - Error reading resource stream.
SAXException - Error parsing the resource stream.
public XMLBinding add(InputStream smooksConfigStream)
throws IOException,
SAXException
AbstractBinding
add in class AbstractBindingsmooksConfigStream - Smooks configuration.
IOException - Error reading resource stream.
SAXException - Error parsing the resource stream.public XMLBinding setReportPath(String reportPath)
AbstractBinding
setReportPath in class AbstractBindingreportPath - The execution report output path.public XMLBinding intiailize()
AbstractBinding
intiailize in class AbstractBindingpublic XMLBinding setOmitXMLDeclaration(boolean omitXMLDeclaration)
toXML(Object, java.io.Writer) method.
omitXMLDeclaration - True if the order is to be omitted, otherwise false.
this instance.
public <T> T fromXML(String inputSource,
Class<T> toType)
T - The Java type to which the XML data is to be bound.inputSource - The XML input.toType - The Java type to which the XML data is to be bound.
public <T> T fromXML(Source inputSource,
Class<T> toType)
throws IOException
T - The Java type to which the XML data is to be bound.inputSource - The XML input.toType - The Java type to which the XML data is to be bound.
IOException
public <W extends Writer> W toXML(Object object,
W outputWriter)
throws BeanSerializationException,
IOException
W - The Writer type.object - The Object instance.outputWriter - The output writer.
Writer instance}.
BeanSerializationException - Error serializing the bean.
IOException - Error writing to the supplied Writer instance.
public String toXML(Object object)
throws BeanSerializationException
toXML(Object, java.io.Writer) method.
object - The Object instance.
BeanSerializationException - Error serializing the bean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||