Smooks smooks = new Smooks(); Value customerNumberValue = new Value( "customerNumber", "customer/@number") .setDecoder("Integer"); Value customerNameValue = new Value( "customerName", "customer") .setDefault("Unknown"); smooks.addVisitors(customerNumberValue); smooks.addVisitors(customerNameValue);And the execution code:
JavaResult result = new JavaResult(); smooks.filterSource(new StreamSource(orderMessageStream), result); Integer customerNumber = (Integer) result.getBean("customerNumber"); String customerName = (String) result.getBean("customerName");@author maurice.zeijen@smies.com @see Bean
|
|
|
|
|
|
|
|
|
|