Package com.tangosol.io.pof.annotation
Annotation Type PortableProperty
-
@Target({FIELD,METHOD}) @Retention(RUNTIME) @Deprecated public @interface PortableProperty
Deprecated.Since Coherence 14.1.2. UsePortable
annotation instead.A PortableProperty marks a member variable or method accessor as a POF serialized attribute. Whilst thevalue()
andcodec()
can be explicitly specified they can be determined by classes that use this annotation. Hence these attributes serve as hints to the underlying parser.- Since:
- 3.7.1
- Author:
- hr
-
-
Element Detail
-
value
int value
Deprecated.The index of this property.- Returns:
- POF index
- See Also:
PofWriter
- Default:
- -1
-
-
-
codec
Class<?> codec
Deprecated.ACodec
to use to override the default behavior in serializing and deserializing a property.The Class specified must have a no-arg constructor and must implement one of:
- Codec - the specified Codec implementation will be instantiated and returned.
- Collection - the specified class should implement the
Collection
interface. A Codec implementation that supports the Collection type will be used. - Map - the specified class should implement the
Map
interface. A Codec implementation that supports the Map type will be used. - LongArray - the specified class should implement the
LongArray
interface. A Codec implementation that supports the LongArray type will be used. - T[] - the provided class should be an array and the component type of the array should have a no-arg constructor. A Codec implementation that supports arrays will be used.
A more complex example could be to specify a custom Codec implementation:{@literal @}PortableProperty(value = 0, codec = LinkedList.class) protected List m_listPeople;
{@literal @}PortableProperty(value = 0, codec = MyArrayListCodec.class) protected List m_listPeople; class MyArrayListCodec implements Codec { public Object decode(PofReader in, int index) throws IOException { in.readCollection(index, new ArrayList(16); } ... }
- Returns:
- a Class representing the codec to use for this property, or a an implementation of a well known type (Collection, Map, LongArray, or an array)
- Default:
- com.tangosol.io.pof.reflect.Codecs.DefaultCodec.class
-
-