Skip to main content
Jump to: navigation, search


< EclipseLink‎ | Examples‎ | MOXy‎ | GettingStarted
Revision as of 14:43, 16 June 2010 by (Talk | contribs) (Overview)


This example will build upon the lessons learned in the previous example (MOXy Extensions), and demonstrate how the annotations can be expressed as XML. This technique is useful in situations where you are not able to modify the domain objects.

Externalized Metadata

The XML metadata below is equivalent to the metadata represented by the annotations used in the previous example.

<?xml version="1.0"?>
        <java-type name="example.gettingstarted.Customer">
            <xml-type prop-order="name address phoneNumbers"/>
                <xml-element java-attribute="name" xml-path="personal-info/name/text()"/>
                <xml-element java-attribute="address" xml-path="contact-info/address"/>
                <xml-element java-attribute="phoneNumbers" xml-path="contact-info/phone-numbers"/>
        <java-type name="example.gettingstarted.PhoneNumber">
                <xml-attribute java-attribute="type"/>
                <xml-value java-attribute="number"/>

Back to the top