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/277920/Phase1"
< EclipseLink | DesignDocs | 277920
(→Annotations) |
m (→Annotations) |
||
Line 5: | Line 5: | ||
== Annotations == | == Annotations == | ||
− | {| class="wikitable" | + | {| class="wikitable" style="width:100%" border="1" |
+ | |+ | ||
+ | ! Annotation !! Package !! Type !! Field !! Method | ||
|- | |- | ||
− | + | | XmlNs || || || || | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | XmlSchema || X || || || |
− | | | + | |
− | | | + | |
− | | | + | |
− | | | + | |
|- | |- | ||
− | | | + | | XmlSeeAlso || || X || || |
− | | X | + | |
− | | | + | |
− | | | + | |
− | | | + | |
|- | |- | ||
− | | | + | | XmlTransient || || X || X || X |
− | | | + | |
− | | | + | |
− | | | + | |
− | | | + | |
− | | | + | |
− | + | ||
− | + | ||
− | | X | + | |
− | | | + | |
− | | X | + | |
|} | |} | ||
Revision as of 13:43, 18 June 2009
Contents
Phase 1
Provide support for boot strapping the JAXBContext.
Annotations
Annotation | Package | Type | Field | Method |
---|---|---|---|---|
XmlNs | ||||
XmlSchema | X | |||
XmlSeeAlso | X | |||
XmlTransient | X | X | X |
Java Example
org.example.customer.package-info.java
@XmlSchema( elementFormDefault=XmlNsForm.QUALIFIED, attributeFormDefault=XmlNsForm.UNQUALIFIED, namespace="urn:customer", xmlns={@XmlNs(prefix="ns1", namespaceURI="urn:customer")}) package org.example.customer; import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema;
org.example.customer.Person
package org.example.customer; import javax.xml.bind.annotation.XmlTransient; @XmlTransient public abstract class Person { private int id; private String name; @XmlTransient public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
org.example.customer.Person
package org.example.customer; import javax.xml.bind.annotation.XmlSeeAlso; import org.example.employee.Employee; @XmlSeeAlso({Employee.class}) public class Customer extends Person { private int customerId; public int getCustomerId() { return customerId; } public void setCustomerId(int customerId) { this.customerId = customerId; } }
org.example.employee.Employee
package org.example.employee; import org.example.customer.Person; public class Employee extends Person { }
XML Example
<?xml version="1.0" encoding="UTF-8"?> <xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"> <xml-schema element-form-default="QUALIFIED" attribute-form-default="UNQUALIFIED" namespace="urn:customer"> <xml-ns prefix="ns1" namespace-uri="urn:customer" /> </xml-schema> <java-types> <java-type name="Person" xml-transient="true"> <java-attributes> <xml-transient java-attribute="id"/> </java-attributes> </java-type> <java-type name="Customer"> <xml-see-also>org.example.employee.Employee</xml-see-also> </java-type> </java-types> </xml-bindings>