Annotation Type MapCodecType
-
@Retention(RUNTIME) @Target(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.
- Since:
- Rhino 2.4.0
-
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description Class<? extends DatatypeCodec>
keyCodec
Map key codec class name.Class<? extends DatatypeCodec>
valueCodec
Map value codec class name.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element 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.
-
-
-
Element Detail
-
keyCodec
Class<? extends DatatypeCodec> keyCodec
Map key codec class name.
- Since:
- Rhino 2.4.0
-
-
-
valueCodec
Class<? extends DatatypeCodec> valueCodec
Map value codec class name.
- Since:
- Rhino 2.4.0
-
-
-
backingStore
EncodableMap.BackingStore backingStore
The type of backing store to use for map elements.
- Since:
- Rhino 2.4.0
- Default:
- com.opencloud.rhino.util.EncodableMap.BackingStore.HASH
-
-
-
manageNullKeys
boolean manageNullKeys
Flag indicating if the serialisation logic should manage null keys.
If this flag is set to
false
and the map might includenull
keys, then theDatatypeCodec
specified bykeyCodec()
must be implemented to support the encoding and decoding ofnull
objects.- Since:
- Rhino 2.4.0
- See Also:
EncodableMap.manageNullKeys()
,EncodableMap.writeKey(Object, DataOutput, EncoderUtils)
- Default:
- false
-
-
-
manageNullValues
boolean manageNullValues
Flag indicating if the serialisation logic should manage null values.
If this flag is set to
false
and the map might includenull
values, then theDatatypeCodec
specified byvalueCodec()
must be implemented to support the encoding and decoding ofnull
objects.- Since:
- Rhino 2.4.0
- See Also:
EncodableMap.manageNullValues()
,EncodableMap.writeValue(Object, DataOutput, EncoderUtils)
- Default:
- true
-
-