* @throws IOException
* @throws SAXException
*/
protected Object fromXmlToObject(String xml, Object root ) throws ActionProcessingException
{
HierarchicalStreamReader reader = null;
try
{
reader = new DomReader( getRootElement( xml, rootNodeName ) );
XStream xstream = new XStream( new DomDriver() );
xstream.alias(getAlias(incomingType), incomingType);
addAliases( aliases, xstream );
XStreamConfigurator.addFieldAliases(fieldAliases, xstream);
addAttributeAliases( attributeAliases, xstream );
addConverters( converters, xstream );
XStreamConfigurator.addImplicitCollections(implicitCollections, xstream);
return xstream.unmarshal( reader, root );
}
finally
{
if ( reader != null) reader.close();
}
}