Showing posts with label jaxb. Show all posts
Showing posts with label jaxb. Show all posts

Monday, October 15, 2012

JAXB: How to unmarshall objects in lists?

On the records property add:
@XmlElementWrapper(name="records")
@XmlElement(name="data")
For more information on JAXB and collection properties see:
http://stackoverflow.com/questions/3683598/jaxb-how-to-unmarshall-objects-in-lists

Thursday, October 11, 2012

JAXB required=true doesn't seem to require

The JAXB reference implementation doesn't use this attribute for validation, it's purely there for documentation purposes. If you need to validate the documents, you need to define an XML Schema, and inject it into the Marshaller or Unmarshaller, using SchemaFactory. http://stackoverflow.com/questions/2669632/jaxb-required-true-doesnt-seem-to-require