Annotation Interface XmlMixed


@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface XmlMixed

Annotate a JavaBean multi-valued property to support mixed content.

The usage is subject to the following constraints:

  • can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement

The following can be inserted into @XmlMixed annotated multi-valued property

  • XML text information items are added as values of java.lang.String.
  • Children element information items are added as instances of JAXBElement or instances with a class that is annotated with @XmlRootElement.
  • Unknown content that is not be bound to a Jakarta XML Binding mapped class is inserted as Element. (Assumes property annotated with @XmlAnyElement)
Below is an example of binding and creation of mixed content. The following is an XML instance document with mixed content that can be constructed using following Jakarta XML Binding API calls.

See "Package Specification" in jakarta.xml.bind.package javadoc for additional common information.

Since:
1.6, JAXB 2.0
Author:
Kohsuke Kawaguchi