Annotation Type XmlWriteOnly


  • @Target({FIELD,METHOD})
    @Retention(RUNTIME)
    public @interface XmlWriteOnly

    Purpose: This annotation indicates that a specific property should be flagged as write-only by EclipseLink. The value for this property will be written out to XML during a marshal, but ignored during unmarshal if flagged as write-only.

    Example:
     @XmlRootElement(name="customer")
     public class Customer {
        ...
        @XmlElement
        @XmlWriteOnly
        public String firstName
        ...
     }