ntlcn / xmappr

Automatically exported from code.google.com/p/xmappr
0 stars 0 forks source link

Non-uniform mapping #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently mapping is done one-to-one between XML and java: one Java class
maps to one XML element. Meaning that Java classes and XML have same structure.

Create a way for Java and XML to be non-uniformly mapped. For example:

<customer>
  <contact>
    <firstname>Joe</firstname>
    <lastname>Somebody</lastname>
  </contact>
  <address>
    <street>Streetname</street>
    <city>Big City</city>
  </address>
</customer>

would be mapped to:

class Customer{ 
  String firstName;
  String lastName;
  String street;
  String city;
}

---------------------------
The other situation is reversed:

<customer>
    <firstname>Joe</firstname>
    <lastname>Somebody</lastname>
    <street>Streetname</street>
    <city>Big City</city>
</customer>

mapped to:

class Customer{ 
  Contact contact;
  Address address;
}

class Contact{
  String firstName;
  String lastName;
}

Class Address{
  String street;
  String city;
}

Original issue reported on code.google.com by peter.kn...@gmail.com on 29 Nov 2009 at 11:58

GoogleCodeExporter commented 8 years ago

Original comment by peter.kn...@gmail.com on 29 Nov 2009 at 11:59

GoogleCodeExporter commented 8 years ago

Original comment by peter.kn...@gmail.com on 30 Nov 2009 at 12:03

GoogleCodeExporter commented 8 years ago

Original comment by peter.kn...@gmail.com on 8 Jan 2010 at 9:04

GoogleCodeExporter commented 8 years ago

Original comment by peter.kn...@gmail.com on 8 Jan 2010 at 9:05