Package com.sun.xml.bind.v2.model.core
Interface MapPropertyInfo<T,C>
- All Superinterfaces:
AnnotationSource
,PropertyInfo<T,
C>
- All Known Subinterfaces:
RuntimeMapPropertyInfo
Property that maps to the following schema fragment.
<xs:complexType>
<xs:sequence>
<xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="key" type="XXXX"/>
<xs:element name="value" type="YYYY"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
This property is used to represent a default binding of a Map
property.
(Map
properties with adapters will be represented by ElementPropertyInfo
.)
Design Thinking Led to This
I didn't like the idea of adding such a special-purpose PropertyInfo
to a model.
The alternative was to implicitly assume an adapter, and have internal representation of
the Entry class ready.
But the fact that the key type and the value type changes with the parameterization makes
it very difficult to have such a class (especially inside Annotation Processing, where we can't even generate
classes.)
- Author:
- Kohsuke Kawaguchi
-
Method Summary
Modifier and TypeMethodDescriptionNonElement<T,
C> Type of the key of the map.NonElement<T,
C> Type of the value of the map.Gets the wrapper element name.boolean
Returns true if this property is nillable (meaning the absence of the value is treated as nil='true')Methods inherited from interface com.sun.xml.bind.v2.model.annotation.AnnotationSource
hasAnnotation, readAnnotation
Methods inherited from interface com.sun.xml.bind.v2.model.core.PropertyInfo
displayName, getAdapter, getExpectedMimeType, getName, getSchemaType, id, inlineBinaryData, isCollection, kind, parent, ref
-
Method Details
-
getXmlName
QName getXmlName()Gets the wrapper element name.- Returns:
- always non-null.
-
isCollectionNillable
boolean isCollectionNillable()Returns true if this property is nillable (meaning the absence of the value is treated as nil='true')This method is only used when this property is a collection.
-
getKeyType
NonElement<T,C> getKeyType()Type of the key of the map. K ofHashMap<K,V>
- Returns:
- never null.
-
getValueType
NonElement<T,C> getValueType()Type of the value of the map. V ofHashMap<K,V>
- Returns:
- never null.
-