Suppose I have a vanilla javabean:
class Person {
String firstName;
String lastName;
...
}
Now suppose I want to transform this into another javabean:
class Human {
String name;
...
}
I'm currently using JXPath to help me transform one to the other:
JXPathContext personContext = JXPathContext.newContext(person);
JXPathContext humanContext = JXPathContext.newContext(new Human());
humanContext.setValue("name", personContext.getValue("firstName") +
personContext.getValue("lastName"));
Instead of doing this sort of things by hand, is there a way to use eg XSLT with JXPath to specify these transformations?