I have an existing XML schema that contains a type that I would like to map to a Java Map of some sort using JAXB. My build process takes the schema and creates the beans. I
Your XJC file is using the "standard" javaType
directive, which I believe is limited to converting String values to and from a representative java type. As such, it's only suitable for converting simple element and attribute content.
The XJC tool provides an enhanced version of javaType
, which in theory should be able to handle more complex structures. Unfortunately, this has yet to be implemented:
https://java.net/jira/browse/JAXB-209 (unresolved)
For instance, being able to map a schema type to a HashMap might be a likely requirement for those using model driven design/implementation. AFAICS, this is not possible today. Therefore, one must manually edit the generated code.
Looks like you're out of luck.
Have you looked at example here (Customized mapping of HashMap): http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/adapters/XmlAdapter.html
Need to create custom XmlAdapter I'm afraid.