Hi,
I am trying to use TypedArrayMapper to
marshall/unmarshall an array with type of Enum. I used
"format" to define conversion between the Enum type
and String. However I am getting following error
message: (
Where LanguageType is an enum. LanguageCollection
contains an array of LanguageType.)
=====================================================
*** Error during code generation - please report this
error on the JiBX users list so that the condition can
be caught during validation ***
org.jibx.runtime.JiBXException: No property for value
at tag "value"(line 19, col 65, in testBinding.xml)
at
org.jibx.runtime.impl.UnmarshallingContext.throwStartTagException(UnmarshallingContext.java:2622)
at
org.jibx.binding.def.BindingBuilder.unmarshalValue(BindingBuilder.java:598)
at
org.jibx.binding.def.BindingBuilder.unmarshalStructureChildren(BindingBuilder.java:841)
at
org.jibx.binding.def.BindingBuilder.unmarshalMapping(BindingBuilder.java:1567)
at
org.jibx.binding.def.BindingBuilder.unmarshalMappings(BindingBuilder.java:973)
at
org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(BindingBuilder.java:1750)
at
org.jibx.binding.Utility.loadBinding(Utility.java:309)
at
org.jibx.binding.Loader.loadBinding(Loader.java:180)
at org.jibx.binding.Run.main(Run.java:182)
======================================================
Here is my mapping file:
<!DOCTYPE binding SYSTEM
"http://www.wrap.com/jibx-binding.dtd">
<binding>
<format type = "test.LanguageType"
label= "LanguageTypeFormat"
serializer= "test.LanguageType.getLanguageName"
deserializer = "test.LanguageType.valueOf"/>
<mapping name = "LanguageCollection"
class = "test.LanguageCollection">
<structure name = "Languages"
field = "languages"
marshaller =
"org.jibx.extras.TypedArrayMapper"
unmarshaller =
"org.jibx.extras.TypedArrayMapper" >
</structure>
</mapping>
<mapping name = "Language" class =
"test.LanguageType">
<value name = "type" format =
"LanguageTypeFormat" />
</mapping>
</binding>
======================================================
The challenge is how to tell JiBX to marshall the Enum
type as an element of an array. If you need more
information, please let me know. Thanks!
Yan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users