org.writersforge.catalan.transform.xml
Class XmlToBean

java.lang.Object
  extended byorg.writersforge.catalan.transform.BaseNodeProcessor
      extended byorg.writersforge.catalan.transform.xml.XmlToBean
All Implemented Interfaces:
org.writersforge.bellows.traverse.NodeProcessor

public class XmlToBean
extends BaseNodeProcessor

A processor which converts each Datum input node into a JavaBean. Each XML-to-JavaBean conversion consists of two consecutive input data nodes: the target JavaBean class (as a fully qualified class name String or as a Class object); and the Datum tree itself. The processor will do its best to reconcile the XML content with the target Java class according to a very simple mapping between XML and JavaBean properties. Data that does not correlate with a JavaBean property or cannot be converted to the desired property type will be ignored.

Author:
jsheets

Constructor Summary
XmlToBean()
          Creates a new instance of BeanToXml.
 
Method Summary
 java.util.List processNode(java.lang.Object node)
          Process a single node.
 
Methods inherited from class org.writersforge.catalan.transform.BaseNodeProcessor
addLeftover, end, getLeftovers, getNodes, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlToBean

public XmlToBean()
Creates a new instance of BeanToXml.

Method Detail

processNode

public java.util.List processNode(java.lang.Object node)
Process a single node. The processing action can be any arbitrary task, such as text replacement, data restructuring, or even statistical gathering. The processor should return a processed version of the node; this can be the same object untouched, or the same object modified, or a new set of objects.

Parameters:
node - the node to process
Returns:
a List of processing results (can be empty)