Open rajalingams opened 4 years ago
I am trying to convert the flat source to the nested destination structure using a single jmapper instance with an xml configuration.
My source class:
class Source { String name; Integer age; String city; }
My destination classes:
class Destination { String fullName; PersonalInfo personalInfo; }
class PersonalInfo { Integer age; String location; }
XML configuration:
<jmapper> <class name="Destination"> <attribute name="fullName"> <value name="name"/> </attribute> <attribute name="personalInfo"> <value name="${}"/> </attribute> </class> <class name="PersonalInfo"> <attribute name="age"> <value name="age"/> </attribute> <attribute name="location"> <value name="city"/> </attribute> </class> </jmapper>
"${}" is not working. I know that it works if the source also has an encapsulated class and it can be passed in. Is there a way to pass the original instance as a whole to personalInfo?
I am trying to convert the flat source to the nested destination structure using a single jmapper instance with an xml configuration.
My source class:
My destination classes:
XML configuration:
"${}" is not working. I know that it works if the source also has an encapsulated class and it can be passed in. Is there a way to pass the original instance as a whole to personalInfo?