![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]()
|
How to map an innner classIntended Audience Prerequisites Basic concept Mapping file Unmarshalling References Intended AudienceAnyone who wants to map an inner class with Castor XML for XML data binding. This document helps people to get familiar with the basic concepts of mapping and shows an example. PrerequisitesA general understanding about XML data binding and its usage. Basic conceptAssume you have the following classes Outer and Inner:
Please note that the i nner class needs to be declared public and static. Mapping fileHere's the mapping file for Castor XML, showing the class mapping for the OrderItem class:
UnmarshallingUsing the Castor XML Unmarshaller with the mapping file shown above, the code to unmarshal the following XML ...
... into a variable of type test.Outer is as follows:
References
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |