|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.io.pof.PofAnnotationSerializer
public class PofAnnotationSerializer
A PofAnnotationSerializer provides annotation based de/serialization. This serializer must be instantiated with the intended class which is eventually scanned for the presence of the following annotations.
This serializer supports classes iff they are annotated with the type level annotation; Portable. This annotation is a marker annotation with no children.
All fields annotated with PortableProperty are explicitly deemed POF serializable with the option of specifying overrides to provide explicit behaviour such as:
<T> to specify concrete implementations / customizationsThe PortableProperty.value() (POF index) can be omitted iff the auto-indexing feature is enabled. This is enabled by instantiating this class with the fAutoIndex constructor argument. This feature determines the index based on any explicit indexes specified and the name of the portable properties. Currently objects with multiple versions is not supported. The following illustrates the auto index algorithm:
| Name | Explicit Index | Determined Index |
| c | 1 | 1 |
| a | 0 | |
| b | 2 |
NOTE: This implementation does support objects that implement Evolvable
Portable| Constructor Summary | |
|---|---|
PofAnnotationSerializer(int nTypeId, java.lang.Class clz)Constructs a PofAnnotationSerializer. |
|
PofAnnotationSerializer(int nTypeId, java.lang.Class clz, boolean fAutoIndex)Constructs a PofAnnotationSerializer. |
|
| Method Summary | |
|---|---|
java.lang.Object |
deserialize(PofReader in)Deserialize a user type instance from a POF stream by reading its state using the specified PofReader object. |
protected com.tangosol.io.pof.reflect.internal.TypeMetadata |
getTypeMetadata()Return the TypeMetadata instance that holds structural information regarding the class this serializer (de)serializes. |
void |
serialize(PofWriter out, java.lang.Object o)Serialize a user type instance to a POF stream by writing its state using the specified PofWriter object. |
| Constructor Detail |
|---|
public PofAnnotationSerializer(int nTypeId,
java.lang.Class clz)
nTypeId - the POF type idclz - type this serializer is aware of
public PofAnnotationSerializer(int nTypeId,
java.lang.Class clz,
boolean fAutoIndex)
nTypeId - the POF type idclz - type this serializer is aware offAutoIndex - turns on the auto index feature| Method Detail |
|---|
public void serialize(PofWriter out,
java.lang.Object o)
throws java.io.IOException
An implementation of PofSerializer is required to follow the following steps in sequence for writing out an object of a user type:
PofWriter.setVersionId(int).PofWriter.writeRemainder(com.tangosol.util.Binary).serialize in interface PofSerializerout - the PofWriter with which to write the object's stateo - the object to serializejava.io.IOException - if an I/O error occurs
public java.lang.Object deserialize(PofReader in)
throws java.io.IOException
An implementation of PofSerializer is required to follow the following steps in sequence for reading in an object of a user type:
PofReader.getVersionId().PofReader.registerIdentity(java.lang.Object) with the new instance prior to reading any properties which are user type instances themselves.PofReader.readRemainder().deserialize in interface PofSerializerin - the PofReader with which to read the object's statejava.io.IOException - if an I/O error occursprotected com.tangosol.io.pof.reflect.internal.TypeMetadata getTypeMetadata()
TypeMetadata instance that holds structural information regarding the class this serializer (de)serializes.
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||