A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a license for
this week in the
XML and Related Technologies
How to map the enum in Castor XML
Joined: Jun 20, 2013
Jun 20, 2013 07:27:02
Please advice what way can I map a class if it contains the field enum.
I use Castor XML.
Thanks in advance.
Joined: Jan 18, 2011
Jun 23, 2013 03:44:46
map a class if it contains the field enum
a class: named EnumContainer mapped to enum-container element
a field: named fieldEnum of Enum SimpleEnum (of bare minimal Enum) mapped to field-enum element
The child block <class> within the <mapping> of the mapping file would look something like this.
<class name="EnumContainer"> <map-to xml="enum-container" /> <field name="fieldEnum" type="SimpleEnum"> <bind-xml name="field-enum" node="element" /> </field> </class>
Potential to get more involved, but that's the bare minimal construction.
I agree. Here's the link:
subject: How to map the enum in Castor XML
Internal working of Castor
Specify namespaces in mapping file
Problem with use Castor from Spring OXM.
XML to Java object using JAXB
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013