|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value=METHOD) @Retention(value=RUNTIME) public @interface MOProperty
Defines a mapping of a Java Property to XML.
The Java property may be of the following types:
MOPropertyEditor
class must be registered with the
MOPropertyEditorRegistry
.
Multi-valued properties (properties that may hold more then one class of Atomic values) are supported via the
MOPolymorphicAtomProperty
annotation.
List
or Set
) that holds one or more
atomic values (defined as for an Atomic property).
The type of the collection items class is read from the generic definition of the collection
(e.g. List&lr;String>
).
Multi-valued collections (collections that may hold more then one class of Atomic values) are supported via the
MOPolymorphicAtomProperty
annotation.
MOPersistentDependentBean
or MOPersistentBean
annotations.
List
or Set
) that holds one or more
beans (as defined for Bean property).
Many annotations are allowed with conjunction with this annotation
MOPropertyGroup
adds grouping XML elements to surround the property value.
MOValidationNumber
adds number facets for atomic properties
or collections of numbers.
MOValidationString
adds string facets for atomic properties
or collections of strings and string derived types.
MOValidationCollection
adds minLength and maxLength facets
for collections.
MOXmlDerivedType
specifies what XML derived type to use
(for instance, use of xs:unsignedInt
instead of xs:long
, or use of xs:NCName
instead of xs:string
.
MOPolymorphicAtomProperty
used to map propeties who is compatible with two or more atomic types.
MOCollectionSort
specifies how to sort a collection property.
MOCollectionCustomSort
specifies how to sort a collection property - using custom sort class.
MOConstructionDescriptor
specifies how contruct Beans for bean properties and collections.
MOEnumSet
specifies special mapping for Java EnumSet
- overriding the default mapping as a
collection.
MOXmlListStyle
specifies mapping a Java list as xml
XML list simple type as apposed to the default mapping.
MOPropertyChoice
specifies to what choice options this property relates too.
MOPropertyGroupBy
TODO
@MOProperty() public String getName() {...}
corresponds to the following XML schema:
<xs:element name="name"> <xs:simpleType> <xs:restriction base="xs:string"> </xs:restriction> </xs:simpleType> </xs:element>
@MOProperty(xmlOrder = 2, xmlName = "employeeName", xmlOptional = true, defaultValue = "Mike") public String getName() {...}
corresponds to the following XML schema:
<xs:element name="employeeName" minOccurs="0" default="mike"> <xs:simpleType> <xs:restriction base="xs:string"> </xs:restriction> </xs:simpleType> </xs:element>
@MOProperty(xmlOrder = 2, xmlName = "employeeName", xmlOptional = true, defaultValue = "Mike", isXmlAttribute = true) public String getName() {...}
corresponds to the following XML schema:
<xs:attribute name="employeeName" default="mike"> <xs:simpleType> <xs:restriction base="xs:string"> </xs:restriction> </xs:simpleType> </xs:attribute>
MOPropertyEditor
,
MOPropertyEditorRegistry
,
MOPolymorphicAtomProperty
,
MOPersistentDependentBean
,
MOPersistentBean
Optional Element Summary | |
---|---|
java.lang.String |
defaultValue
defines the default value of the XML element. |
boolean |
isXmlAttribute
defines if the value is written as an XML attribute or an XML element |
java.lang.String |
xmlName
the xmlName() value defines the xml element or attribute name of the property. |
boolean |
xmlOptional
defines if the value is optional in the XML representation. |
int |
xmlOrder
defines the order at which the property appears in the XML representation. |
public abstract java.lang.String xmlName
xmlName()
value defines the xml element or attribute name of the property. If not specified, the
Java property name is used
public abstract int xmlOrder
public abstract boolean xmlOptional
public abstract boolean isXmlAttribute
public abstract java.lang.String defaultValue
The default value is written in terms of the string representation of the property type, as defined by the
matching MOPropertyEditor
class.
MOPropertyEditor.toString(Class, java.lang.Object)
,
MOPropertyEditor.fromString(Class, String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |