Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/DesignDocs/317962/Phase2.1

< EclipseLink‎ | DesignDocs‎ | 317962
Revision as of 15:29, 9 July 2010 by Unnamed Poltroon (Talk) (Example: Property-level xml-properties)

Phase 2.1 - Additional MOXy external metadata support

This phase of development involves providing additional MOXy external metadata support that allows similar configuration abilities as with deployment XML

Xml Metadata Tags

The following Xml metadata tags will be targeted in this phase:

XML Metadata Tag MOXy Annotation Package Type Field Method
xml-class-extractor XmlClassExtractor   X    
xml-property XmlProperty   X X X
xml-properties XmlProperties   X X X
xml-transformation XmlTransformation        
xml-read-transformer XmlReadTransformer        
xml-write-transformer XmlWriteTransformer        
xml-write-transformers XmlWriteTransformers        

Example: xml-class-extractor

The following example will demonstrate how the xml-class-extractor can be applied.

Setting xml-class-extractor via EclipseLink XML metadata can be accomplished as follows:

<java-type name="org.example.Employee">
    <xml-class-extractor class="org.example.MyClassExtractor" />
</java-type>

Example: Type-level xml-property

The following example will demonstrate how a type-level xml-property can be applied.

Setting xml-property on a type via EclipseLink XML metadata can be accomplished as follows:

<java-type name="org.example.Employee">
    <xml-property name="identifier" value="101" value-type="Integer.class" />
</java-type>

Example: Property-level xml-property

The following example will demonstrate how a property-level xml-property can be applied.

Setting xml-property on a field/method via EclipseLink XML metadata can be accomplished as follows:

<java-type name="org.example.Employee">
    <java-attributes>
        <xml-element java-attribute="myelement">
            <xml-property name="isAttribute" value="false" value-type="Boolean.class" />
        </xml-element>
    </java-attributes>
</java-type>

Example: Type-level xml-properties

The following example will demonstrate how type-level xml-properties can be applied.

Setting xml-properties on a type via EclipseLink XML metadata can be accomplished as follows:

<java-type name="org.example.Employee">
    <xml-properties>
        <xml-property name="identifier" value="101" value-type="Integer.class" />
        <xml-property name="isTrue" value="false" value-type="Boolean.class" />
    </xml-properties>
</java-type>

Example: Property-level xml-properties

The following example will demonstrate how property-level xml-properties can be applied.

Setting xml-properties on a field/method via EclipseLink XML metadata can be accomplished as follows:

<java-type name="org.example.Employee">
    <java-attributes>
        <xml-element java-attribute="myelement">
            <xml-properties>
                <xml-property name="isAttribute" value="false" value-type="Boolean.class" />
                <xml-property name="comment" value="this is an element" value-type="String.class" />
            </xml-properties>
        </xml-element>
    </java-attributes>
</java-type>

Back to the top