![]() |
|
|
|
|
Issue Type:
|
New Feature
|
|
Assignee:
|
Jörg Schaible
|
|
Attachments:
|
constructor-converter-patch.diff |
|
Components:
|
Annotations, Converters |
|
Created:
|
22/Jan/13 11:14 AM
|
|
Description:
|
A new way to create a converter using the constructor instead the setters and specifying which nodes of the xml you want to use:
private static class Order {
private final String buyer;
protected Order(String buyer) {
this.buyer = buyer;
}
}
Converter orderConverter = ConstructorConverter.forType(Order.class)
.withConstructor(String.class)
.withAliases("buyer")
.build();
xStream.registerConverter(orderConverter);
Order order = (Order) xStream.fromXML(xml);
I am attaching the patch implementing that feature ![]()
|
|
Project:
|
XStream
|
|
Priority:
|
Minor
|
|
Reporter:
|
Leonardo Wolter
|
|
|
|
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email