Skip to main content
Jump to: navigation, search


Phase 6 - Substitution Groups (page under construction)

Provide support for substitution groups.


The following annotations will be targeted in this phase:

Annotation XML Metadata Tag Package Type Field Method
XmlElements xml-elements     X X
XmlElementRef xml-element-ref     X X
XmlElementRefs xml-element-refs X

Example: XmlElements annotation

Java Metadata

The following example will demonstrate how the XmlElements annotation can be applied:

package org.example;
public class Foo {
        @javax.xml.bind.annotation.XmlElement(name="A", type=Integer.class),
        @javax.xml.bind.annotation.XmlElement(name="B", type=Float.class)
    public java.util.List items;

XML Metadata


If this is present in the XML then it completely replaces the corresponding annotation.


This XML file represents metadata overrides for the org.example.Foo class.

<?xml version="1.0" encoding="US-ASCII"?>
<xml-bindings xmlns="">
        <java-type name="org.example.Foo">
            <xml-root-element name="foo"/>
                <xml-elements java-attribute="items">
                    <xml-element java-attribute="A" type="java.lang.Integer" />
                    <xml-element java-attribute="B" type="java.lang.Float" />

Back to the top