Package com.tangosol.io.pof.annotation
Annotation Interface PortableProperty
Deprecated.
A PortableProperty marks a member variable or method accessor as a
POF serialized attribute. Whilst the
value()
and
codec()
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
-
Optional Element Summary
-
Element Details
-
value
int valueDeprecated.The index of this property.- Returns:
- POF index
- See Also:
- Default:
-1
-
codec
Class<?> codecDeprecated.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
-
Portable
annotation instead.