com.abra.j2xb.annotations
Annotation Type MOEnumSet


@Target(value={METHOD,PARAMETER})
@Retention(value=RUNTIME)
public @interface MOEnumSet

Defines an alternate mapping of Set of Enum using an boolean XML attribute for each enumeration option.

given the following mapping

 @MOProperty(xmlOrder = 6, xmlName = "properties2", xmlOptional = true)
 @MOEnumSet(defaultValues={"hasPhone", "hasCard"})
 public Set<EmployeeProperties> getEmployeeProperties2() {
         return employeeProperties2;
 }

 public enum EmployeeProperties {hasCar, hasPhone, hasCard}
 

the corresponding XML schema fragment will be

 <xs:element name="properties2" minOccurs="0">
         <xs:complexType>
                 <xs:attribute name="hasCar" type="xs:boolean" use="optional" default="false"/>
                 <xs:attribute name="hasPhone" type="xs:boolean" use="optional" default="true"/>
                 <xs:attribute name="hasCard" type="xs:boolean" use="optional" default="true"/>
         </xs:complexType>
 </xs:element>
 

Since:
JDK1.5
Version:
1.0, Dec 10, 2007
Author:
Yoav Abrahami
See Also:
MOProperty

Optional Element Summary
 java.lang.String[] defaultValues
          Optional default values for the property.
 

defaultValues

public abstract java.lang.String[] defaultValues
Optional default values for the property. If not specified, it is assumed the property is an empty set.

Default:
{}


Copyright © 2008. All Rights Reserved.