Skip to main content

xjc - inline annotation for generating a property of type Map/Hashtable

1 reply [Last post]
Joined: 2005-12-14

I have already read some articles where custom class and XmlAdapter is used to marshal a java.util.Map-property. Is it possible to generate this code by using inline annotations in xsd? Should I write my XmlAdapter and reference it from xsd?
I suppose it should look like this:


public class MyClass{
Map attributes; // or Map
String property2;...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-09

I'm afraid there's no schema customization to have XJC generate a map.