|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.process.workers.BaseMetadataHolder
org.writersforge.catalan.process.commands.BaseCommand
org.writersforge.catalan.process.workers.javabean.BeanToXmlCommand
Implementation of "bean-to-xml" command.
A helper which converts each input node into an XML tree. Input nodes
of a fundamental type like Integer or String are
converted into a single Datum element. Composite JavaBean input nodes are
recursed and converted into a closely mapped XML tree. The XML naming
conventions can be controlled by parameters, e.g., <theRoot>,
<TheRoot>, <the-root>, <the_root>, <THE-ROOT>, or
<THE_ROOT>. Complex types like arrays and embedded JavaBeans will
always manifest as element content, but primitive JavaBean properties can
be configured to show up as attributes or as element content.
This class can also be used as a standalone utility, outside the context
of a worker runtime, by calling the convertBean() method
directly.
| Constructor Summary | |
BeanToXmlCommand()
Creates a new instance of BeanToXmlCommand. |
|
| Method Summary | |
org.writersforge.bellows.Datum |
convertBean(java.lang.Object node,
org.writersforge.bellows.util.PropertyName.PropertyStyle style,
boolean collapse)
Converts an arbitrary JavaBean object into a Bellows XML tree. |
void |
run(CommandContext context)
Invokes this command against the given workspace with the given runtime properties. |
| Methods inherited from class org.writersforge.catalan.process.workers.BaseMetadataHolder |
getMetadata, setOptionalProperties, setRequiredProperties, validateProperties, validateType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.writersforge.catalan.process.workers.IMetadataHolder |
getMetadata, validateProperties, validateType |
| Constructor Detail |
public BeanToXmlCommand()
throws MetadataException
MetadataException - if unable to initialize metadata| Method Detail |
public void run(CommandContext context)
throws ProcessException
run().
context - command context
ProcessException - if a fatal error occurs during processing
public org.writersforge.bellows.Datum convertBean(java.lang.Object node,
org.writersforge.bellows.util.PropertyName.PropertyStyle style,
boolean collapse)
node - JavaBean objectstyle - XML naming stylecollapse - true to represent properties as XML attributes, or
false to represent them as nested elements
PropertyName.PropertyStyle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||