|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.coherence.rest.io.KeyConverterAdapter
public class KeyConverterAdapter
Marshaller that marshalls objects using a cache's key converter.
Field Summary |
---|
Fields inherited from interface com.tangosol.coherence.rest.io.Marshaller |
---|
FORMAT_OUTPUT |
Constructor Summary | |
---|---|
KeyConverterAdapter(KeyConverter converter) Construct KeyConverterAdapter instance. |
Method Summary | |
---|---|
void |
marshal(java.lang.Object oValue, java.io.OutputStream out) Write the specified object into the given stream. |
void |
marshalAsFragment(java.lang.Object oValue, java.io.OutputStream out) Write the specified object into the given stream as a fragment. |
java.lang.Object |
unmarshal(java.io.InputStream in) Read an object from the specified stream. |
Constructor Detail |
---|
public KeyConverterAdapter(KeyConverter converter)
converter
- key converter used to marshall key objectsMethod Detail |
---|
public void marshal(java.lang.Object oValue, java.io.OutputStream out) throws java.io.IOException
marshal
in interface Marshaller
oValue
- object to marshallout
- stream to write tojava.io.IOException
- if an error occurs during marshallingpublic void marshalAsFragment(java.lang.Object oValue, java.io.OutputStream out) throws java.io.IOException
This method is called when marshalling collections of objects, as marshalling behavior might differ when an object is serialized directly or as element of a collection.
For example, when marshalling a collection of objects into XML, you need to ensure that the XML declaration is emmitted only once, not for each object in the collection.
In cases where there is no difference in output between fragments and full objects (JSON, for example), this method could simply delegate to Marshaller.marshal(Object, OutputStream)
.
marshalAsFragment
in interface Marshaller
oValue
- object to marshallout
- stream to write tojava.io.IOException
- if an error occurs during marshallingpublic java.lang.Object unmarshal(java.io.InputStream in) throws java.io.IOException
unmarshal
in interface Marshaller
in
- stream to read fromjava.io.IOException
- if an error occurs during unmarshalling
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |