|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.soa.esb.actions.AbstractActionLifecycle
org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
org.jboss.soa.esb.actions.converters.AbstractObjectXStream
org.jboss.soa.esb.actions.converters.XStreamToObject
public class XStreamToObject
Object to processor.
Uses the XStream processor to generate an XML message String from the supplied object. Sample Action Configuration:
<Action name="doCustomer" processor="XStreamObject">
<property name="class-alias" value="Customer" /> <!-- Optional. Class alias used in call to XStream.alias(String, Class) prior to deserialisation. -->
<property name="incoming-type" value="CustomerProcessor" /> <!-- Required. Class for incoming type used to process the message after deserialisation. -->
<property name="exclude-package" value="false" /> <!-- Optional. Default "true". Not applicable if a "class-alias" is specified. -->
<property name="root-node" value="/root/Customer" />
<!-- Optional. Specify an XPath expression be used to determine the root node used with XStream.
Useful when the object to convert is not the root node of the document -->
<property name="aliases"> <!-- Optional list of extra aliases to add to XStream -->
<alias name="aliasName" class="className" />
<alias name="aliasName" class="className" />
...
</property>
<property name="converters"> <!-- Optional list of converter to register with XStream -->
<converter class="className" />
<converter class="className" />
...
</Action>
The XML root element is either set from the "class-alias" property or the classes full name. In the later case, the class package is
excluded unless "exclude-package" is set to "false"/"no".
This can be used with ObjectToXStream
| Field Summary |
|---|
| Fields inherited from class org.jboss.soa.esb.actions.converters.AbstractObjectXStream |
|---|
classAlias, classMethod, classProcessor, excludePackage, processorClass, rootNodeName |
| Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor |
|---|
PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD |
| Constructor Summary | |
|---|---|
|
XStreamToObject(ConfigTree properties)
Public constructor. |
protected |
XStreamToObject(java.lang.String actionName,
java.util.List<KeyValuePair> properties)
Public constructor. |
| Method Summary | |
|---|---|
protected void |
addAliases(java.util.Map<java.lang.String,java.lang.String> aliases,
com.thoughtworks.xstream.XStream xstream)
Added the aliases contained in the passed-in map to the passed-in XStream object |
protected void |
addAttributeAliases(java.util.Map<java.lang.String,java.lang.String> aliases,
com.thoughtworks.xstream.XStream xstream)
Added the aliases contained in the passed-in map to the passed-in XStream object |
protected void |
addConverters(java.util.List<java.lang.String> converters,
com.thoughtworks.xstream.XStream xstream)
Registers the converters contained in the passed in list |
protected java.lang.Object |
fromXmlToObject(java.lang.String xml,
java.lang.Object root)
|
protected java.util.Map<java.lang.String,java.lang.String> |
getAliases(ConfigTree configTree,
java.lang.String childName)
Will extract the alias elements from the passed-in conifgTree |
protected java.util.List<java.lang.String> |
getConverters(ConfigTree configTree,
java.lang.String childName)
Will extract the converter elements from the passed-in conifgTree |
Message |
process(Message message)
Processes the message by using the giving class-processor. |
| Methods inherited from class org.jboss.soa.esb.actions.converters.AbstractObjectXStream |
|---|
getAlias, getName, getRootNodeName, setName |
| Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor |
|---|
processException, processSuccess |
| Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle |
|---|
destroy, initialise |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle |
|---|
destroy, initialise |
| Constructor Detail |
|---|
public XStreamToObject(ConfigTree properties)
properties - Action Properties.
ConfigurationException - Action not properly configured.
protected XStreamToObject(java.lang.String actionName,
java.util.List<KeyValuePair> properties)
actionName - Action name.properties - Action Properties.
ConfigurationException - Action not properly configured.| Method Detail |
|---|
public Message process(Message message)
throws ActionProcessingException
message - The current message being processed.
ActionProcessingException - for errors during processing.
protected java.util.Map<java.lang.String,java.lang.String> getAliases(ConfigTree configTree,
java.lang.String childName)
configTree - the configuration for this class
protected java.util.List<java.lang.String> getConverters(ConfigTree configTree,
java.lang.String childName)
configTree - the configuration for this class
protected void addAliases(java.util.Map<java.lang.String,java.lang.String> aliases,
com.thoughtworks.xstream.XStream xstream)
throws ActionProcessingException
aliases - Map of aliases.
ActionProcessingException
protected void addConverters(java.util.List<java.lang.String> converters,
com.thoughtworks.xstream.XStream xstream)
throws ActionProcessingException
converters - which should be registered with XStreamxstream -
ActionProcessingException
protected void addAttributeAliases(java.util.Map<java.lang.String,java.lang.String> aliases,
com.thoughtworks.xstream.XStream xstream)
throws ActionProcessingException
aliases - Map of aliases.
ActionProcessingException
protected java.lang.Object fromXmlToObject(java.lang.String xml,
java.lang.Object root)
throws ActionProcessingException
xml - the xml Stringroot - an instance of the type of the root element
ActionProcessingException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||