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

Difference between revisions of "EclipseLink/DesignDocs/317962/Phase1"

(Annotations)
Line 8: Line 8:
 
The following annotations will be targeted in this phase:  
 
The following annotations will be targeted in this phase:  
  
{|{{BMTableStyle}}
+
{|
|-{{BMTHStyle}}
+
|-
 
! Annotation  
 
! Annotation  
 
! XML Metadata Tag  
 
! XML Metadata Tag  
Line 17: Line 17:
 
! Method
 
! Method
 
|-
 
|-
| XmlReadOnly
+
| XmlReadOnly  
| read-only
+
| read-only  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlWriteOnly
+
| XmlWriteOnly  
| write-only
+
| write-only  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 +
| align="center" | X
 
| align="center" | X
 
| align="center" | X
| align="center" | X
+
|-
| -
+
| XmlCDATA  
| XmlCDATA
+
| cdata  
| cdata
+
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlAccessMethods
+
| XmlAccessMethods  
| xml-access-methods
+
| xml-access-methods  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlPaths
+
| XmlPaths  
| xml-elements
+
| xml-elements  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlNullPolicy
+
| XmlNullPolicy  
| xml-null-policy
+
| xml-null-policy  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlIsSetNullPolicy
+
| XmlIsSetNullPolicy  
| xml-is-set-null-policy
+
| xml-is-set-null-policy  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlIsSetParameters
+
| XmlIsSetParameters  
| n/a
+
| n/a  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|-
 
|-
| XmlIsSetParameter
+
| XmlIsSetParameter  
| is-set-parameter
+
| is-set-parameter  
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
 
| align="center" |    
| align="center" | X
+
| align="center" | X  
 
| align="center" | X
 
| align="center" | X
 
|}
 
|}
 
  
 
== Example: XmlReadOnly annotation ==
 
== Example: XmlReadOnly annotation ==

Revision as of 11:22, 25 June 2010

Phase 1 - Provide MOXy annotation support equivalent to our XML metadata support

This phase of development involves providing MOXy annotation support equivalent to the existing EclipseLink XML metadata support

Annotations

The following annotations will be targeted in this phase:

Annotation XML Metadata Tag Package Type Field Method
XmlReadOnly read-only     X X
XmlWriteOnly write-only     X X
XmlCDATA cdata     X X
XmlAccessMethods xml-access-methods     X X
XmlPaths xml-elements     X X
XmlNullPolicy xml-null-policy     X X
XmlIsSetNullPolicy xml-is-set-null-policy     X X
XmlIsSetParameters n/a     X X
XmlIsSetParameter is-set-parameter     X X

Example: XmlReadOnly annotation

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

A property can be configured to be read-only via XML metadata as follows:

<xml-attribute java-attribute="salary" read-only="true" />

The equivalent configured via annotations would look like:

package org.example;
 
public class Employee {
    @javax.xml.bind.annotation.XmlAttribute
    @org.eclipse.persistence.oxm.annotations.XmlReadOnly
    public String salary;
}

Following is the proposed XmlReadOnly annotation:

package org.eclipse.persistence.oxm.annotations;
 
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface XmlReadOnly {
    Boolean value();
}

Example: XmlWriteOnly annotation

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

A property can be configured to be write-only via XML metadata as follows:

<xml-attribute java-attribute="salary" write-only="true" />

The equivalent configured via annotations would look like:

package org.example;
 
public class Employee {
    @javax.xml.bind.annotation.XmlAttribute
    @org.eclipse.persistence.oxm.annotations.XmlWriteOnly
    public String salary;
}

Following is the proposed XmlWriteOnly annotation:

package org.eclipse.persistence.oxm.annotations;
 
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface XmlWriteOnly {
    Boolean value();
}

Back to the top