Skip to main content

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

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

Hi,
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:

[code]

public class MyClass{
Map attributes; // or Map
String property2;...
}
[code]

Reply viewing options

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

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