Skip to content

Jackson XML annotations

cowtowncoder edited this page Mar 12, 2013 · 6 revisions

Additional XML-specific annotations

@JacksonXmlElementWrapper

Allows specifying XML element to use for wrapping List and Map properties; or disabling use (with 'useWrapping' set to false).

Properties:

  • namespace (default: ""_: Which XML namespace to use for wrapper element (defaults to: "")
  • localName: Local name for wrapper element
  • useWrapping (default:true) Whether to use wrapper element or not: by specifying 'false' one can disable use

@JacksonXmlProperty

Allows specifying XML namespace and local name for a property; as well as whether property is to be written as an XML element or attribute.

@JacksonXmlRootElement

Allows specifying XML element to use for wrapping the root element (default uses 'simple name' of the value class)

@JacksonXmlText

Allows specifying that value of one property is to be serialized as "unwrapped" text, and not in an element.

Clone this wiki locally