Top Description Methods
org.glassfish.jaxb.core.v2.model.core

public Interface MapPropertyInfo<T, C>

extends PropertyInfo<T, C>
Known Direct Subinterfaces
org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeMapPropertyInfo
Known Direct Implementers
org.glassfish.jaxb.runtime.v2.model.impl.MapPropertyInfoImpl
Imports
java.util.Map, javax.xml.namespace.QName

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 TypeMethod and Description
public NonElement<T, C>

Returns:

never null.
getKeyType
()

Type of the key of the map.

public NonElement<T, C>

Returns:

never null.
getValueType
()

Type of the value of the map.

public QName

Returns:

always non-null.
getXmlName
()

Gets the wrapper element name.

public 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.

Inherited from org.glassfish.jaxb.core.v2.model.core.PropertyInfo:
displayNamegetAdaptergetExpectedMimeTypegetNamegetSchemaTypeidinlineBinaryDataisCollectionkindparentref

Method Detail

getKeyTypeback to summary
public NonElement<T, C> getKeyType()

Type of the key of the map. K of HashMap<K,V>

Returns:NonElement<T, C>

never null.

getValueTypeback to summary
public NonElement<T, C> getValueType()

Type of the value of the map. V of HashMap<K,V>

Returns:NonElement<T, C>

never null.

getXmlNameback to summary
public QName getXmlName()

Gets the wrapper element name.

Returns:QName

always non-null.

isCollectionNillableback to summary
public 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.