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.
Difference between revisions of "EclipseLink/DesignDocs/317962/Phase2.1"
(→Xml Metadata Tags) |
|||
Line 99: | Line 99: | ||
<xml-element java-attribute="myelement"> | <xml-element java-attribute="myelement"> | ||
<xml-property name="isAttribute" value="false" value-type="Boolean.class" /> | <xml-property name="isAttribute" value="false" value-type="Boolean.class" /> | ||
+ | </xml-element> | ||
+ | </java-attributes> | ||
+ | </java-type> | ||
+ | </source> | ||
+ | |||
+ | == Example: Type-level xml-properties == | ||
+ | |||
+ | The following example will demonstrate how a type-level <code>xml-properties</code> can be applied: | ||
+ | |||
+ | Setting <code>xml-properties</code> on a type via [http://wiki.eclipse.org/EclipseLink/DesignDocs/293925/MOXyExtensions EclipseLink XML metadata] can be accomplished as follows: | ||
+ | <source lang="xml"> | ||
+ | <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> | ||
+ | </source> | ||
+ | |||
+ | == Example: Property-level xml-properties == | ||
+ | |||
+ | The following example will demonstrate how a property-level <code>xml-properties</code> can be applied: | ||
+ | |||
+ | Setting <code>xml-properties</code> on a field/method via [http://wiki.eclipse.org/EclipseLink/DesignDocs/293925/MOXyExtensions EclipseLink XML metadata] can be accomplished as follows: | ||
+ | <source lang="xml"> | ||
+ | <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> | </xml-element> | ||
</java-attributes> | </java-attributes> | ||
</java-type> | </java-type> | ||
</source> | </source> |
Revision as of 15:27, 9 July 2010
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 a 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 a 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>