Annotation Type 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. {@snippet : public class LetterBody { // Mixed content can contain instances of Element classes // Name, Quantity and ProductName. Text data is represented as // java.util.String for text.
    Since:
    1.6, JAXB 2.0
    Author:
    Kohsuke Kawaguchi