@Retention(value=RUNTIME) @Target(value=METHOD) @Documented public @interface MapCodecType
Annotation that can be used on a map-type CMP field getter or setter method to indicate to Rhino codecs that should be used to serialise and serialise map keys and values.
The CMP field must be declared with type Map
or an array of this type.
For a given map with key type X and value type Y:
the specified key DatatypeCodec
implementation class must have a type parameter T that is equal to X, or if T is itself a type variable then it must have an upper bound equal to X.
the specified value DatatypeCodec
implementation class must have a type parameter T that is equal to Y, or if T is itself a type variable then it must have an upper bound equal to Y.
Modifier and Type | Required Element and Description |
---|---|
Class<? extends DatatypeCodec> |
keyCodec
Map key codec class name.
|
Class<? extends DatatypeCodec> |
valueCodec
Map value codec class name.
|
Modifier and Type | Optional Element and Description |
---|---|
EncodableMap.BackingStore |
backingStore
The type of backing store to use for map elements.
|
boolean |
manageNullKeys
Flag indicating if the serialisation logic should manage null keys.
|
boolean |
manageNullValues
Flag indicating if the serialisation logic should manage null values.
|
public abstract Class<? extends DatatypeCodec> keyCodec
Map key codec class name.
public abstract Class<? extends DatatypeCodec> valueCodec
Map value codec class name.
public abstract EncodableMap.BackingStore backingStore
The type of backing store to use for map elements.
public abstract boolean manageNullKeys
Flag indicating if the serialisation logic should manage null keys.
If this flag is set to false
and the map might include null
keys, then the DatatypeCodec
specified by keyCodec()
must be implemented to support the encoding and decoding of null
objects.
EncodableMap.manageNullKeys()
,
EncodableMap.writeKey(Object, DataOutput, EncoderUtils)
public abstract boolean manageNullValues
Flag indicating if the serialisation logic should manage null values.
If this flag is set to false
and the map might include null
values, then the DatatypeCodec
specified by valueCodec()
must be implemented to support the encoding and decoding of null
objects.
EncodableMap.manageNullValues()
,
EncodableMap.writeValue(Object, DataOutput, EncoderUtils)