|
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.util.Base
com.tangosol.io.pof.PofHelper
com.tangosol.io.pof.PofBufferWriter
com.tangosol.io.pof.PofBufferWriter.UserTypeWriter
public static class PofBufferWriter.UserTypeWriter
The UserTypeWriter implementation is a contextually-aware PofWriter whose purpose is to write the properties of a value of a specified user type. The "contextual awareness" refers to the fact that the UserTypeWriter maintains state about the type identifier, the PofWriter's property index position within the user type value, and a PofContext that may differ from the PofContext that provided the PofSerializer which is using this UserTypeWriter to serialize a user type.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.tangosol.io.pof.PofBufferWriter |
|---|
PofBufferWriter.ReferenceLibrary, PofBufferWriter.UserTypeWriter |
| Nested classes/interfaces inherited from class com.tangosol.io.pof.PofHelper |
|---|
PofHelper.ReadableEntrySetMap, PofHelper.WriteableEntrySetMap |
| Field Summary | |
|---|---|
protected WritingPofHandler.Complex |
m_complexThe Complex value that corresponds to the user type that is being written. |
protected boolean |
m_fUserTypeBeginTrue iff the type and version identifier of the user type was written to the POF stream. |
protected boolean |
m_fUserTypeEndTrue iff the user type was written to the POF stream. |
protected int |
m_iPrevPropThe index of the last property written to the POF stream or -1 if the first property has yet to be written. |
protected int |
m_iPropThe index of the user type being written. |
protected int |
m_nIdThe identity of the object to encode, or -1 if the identity shouldn't be encoded in the POF stream |
protected int |
m_nTypeIdThe type identifier of the user type that is being written. |
protected int |
m_nVersionIdThe version identifier of the user type that is being written. |
protected PofBufferWriter.UserTypeWriter |
m_writerNestedThe currently open nested writer, if any. |
| Fields inherited from class com.tangosol.io.pof.PofBufferWriter |
|---|
m_ctx, m_fEvolvable, m_handler, m_out, m_refs |
| Fields inherited from class com.tangosol.io.pof.PofHelper |
|---|
BIGDECIMAL_ZERO, BIGINTEGER_MAX_LONG, BIGINTEGER_MIN_LONG, BINARY_EMPTY, BOOLEAN_ARRAY_EMPTY, BYTE_ARRAY_EMPTY, CHAR_ARRAY_EMPTY, COLLECTION_EMPTY, DOUBLE_ARRAY_EMPTY, FLOAT_ARRAY_EMPTY, INT_ARRAY_EMPTY, LONG_ARRAY_EMPTY, OBJECT_ARRAY_EMPTY, SHORT_ARRAY_EMPTY |
| Constructor Summary | |
|---|---|
PofBufferWriter.UserTypeWriter(PofBufferWriter parent, WriteBuffer.BufferOutput out, PofContext ctx, int nTypeId, int iProp)Construct a UserTypeWriter for writing the property values of a user type. |
|
PofBufferWriter.UserTypeWriter(PofBufferWriter parent, WritingPofHandler handler, PofContext ctx, int nTypeId, int iProp)Construct a UserTypeWriter for writing the property values of a user type. |
|
PofBufferWriter.UserTypeWriter(PofBufferWriter parent, WritingPofHandler handler, PofContext ctx, int nTypeId, int iProp, int nId)Construct a UserTypeWriter for writing the property values of a user type. |
|
PofBufferWriter.UserTypeWriter(WriteBuffer.BufferOutput out, PofContext ctx, int nTypeId, int iProp)Construct a UserTypeWriter for writing the property values of a user type. |
|
PofBufferWriter.UserTypeWriter(WritingPofHandler handler, PofContext ctx, int nTypeId, int iProp)Construct a UserTypeWriter for writing the property values of a user type. |
|
| Method Summary | |
|---|---|
protected void |
beginProperty(int iProp)Report that a POF property is about to be written to the POF stream. |
protected void |
closeNested()Notify the UserTypeWriter that it is being "closed". |
PofWriter |
createNestedPofWriter(int iProp)Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type. |
void |
enableReference()Ensure that reference support (necessary for cyclic dependencies) is enabled. |
protected void |
endProperty(int iProp)Signifies the termination of the current POF property. |
protected PofBufferWriter |
getParentWriter()If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type. |
int |
getUserTypeId()Determine the user type that is currently being written. |
int |
getVersionId()Determine the version identifier of the user type that is currently being written. |
protected boolean |
isEvolvable()Determine if the object to be written is either Evolvable or part of an Evolvable object. |
protected void |
onException(java.lang.Exception e)Called when an unexpected exception is caught while writing to the POF stream. |
void |
setVersionId(int nVersionId)Set the version identifier of the user type that is currently being written. |
void |
writeRemainder(Binary binProps)Write the remaining properties to the POF stream, terminating the writing of the currrent user type. |
protected void |
writeUserTypeInfo()Write out the type and version identifiers of the user type to the POF stream, if they haven't already been written. |
| Field Detail |
|---|
protected int m_nTypeId
protected int m_nVersionId
protected int m_iProp
protected int m_nId
protected int m_iPrevProp
protected boolean m_fUserTypeBegin
protected boolean m_fUserTypeEnd
protected WritingPofHandler.Complex m_complex
protected PofBufferWriter.UserTypeWriter m_writerNested
| Constructor Detail |
|---|
public PofBufferWriter.UserTypeWriter(WriteBuffer.BufferOutput out,
PofContext ctx,
int nTypeId,
int iProp)
out - the BufferOutput object to write to; must not be nullctx - the PofContext to use for writing the user type property values within the user type that this writer will be writingnTypeId - the type identifier of the user type; must be non-negativeiProp - the index of the user type being written
public PofBufferWriter.UserTypeWriter(PofBufferWriter parent,
WriteBuffer.BufferOutput out,
PofContext ctx,
int nTypeId,
int iProp)
parent - the containing PofBufferWriterout - the BufferOutput object to write to; must not be nullctx - the PofContext to use for writing the user type property values within the user type that this writer will be writingnTypeId - the type identifier of the user type; must be non-negativeiProp - the index of the user type being written
public PofBufferWriter.UserTypeWriter(WritingPofHandler handler,
PofContext ctx,
int nTypeId,
int iProp)
handler - the WritingPofHandler used to write user type data (except for the user type id itself, which is passed as a constructor argument)ctx - the PofContext to use for writing the user type property values within the user type that this writer will be writingnTypeId - the type identifier of the user type; must be non-negativeiProp - the index of the user type being written
public PofBufferWriter.UserTypeWriter(PofBufferWriter parent,
WritingPofHandler handler,
PofContext ctx,
int nTypeId,
int iProp)
parent - the containing PofBufferWriterhandler - the WritingPofHandler used to write user type data (except for the user type id itself, which is passed as a constructor argument)ctx - the PofContext to use for writing the user type property values within the user type that this writer will be writingnTypeId - the type identifier of the user type; must be non-negativeiProp - the index of the user type being written
public PofBufferWriter.UserTypeWriter(PofBufferWriter parent,
WritingPofHandler handler,
PofContext ctx,
int nTypeId,
int iProp,
int nId)
parent - the containing PofBufferWriterhandler - the WritingPofHandler used to write user type data (except for the user type id itself, which is passed as a constructor argument)ctx - the PofContext to use for writing the user type property values within the user type that this writer will be writingnTypeId - the type identifier of the user type; must be non-negativeiProp - the index of the user type being writtennId - the identity of the object to encode, or -1 if the identity shouldn't be encoded in the POF stream| Method Detail |
|---|
public int getUserTypeId()
getUserTypeId in interface PofWritergetUserTypeId in class PofBufferWriterpublic int getVersionId()
getVersionId in interface PofWritergetVersionId in class PofBufferWriterpublic void setVersionId(int nVersionId)
setVersionId in interface PofWritersetVersionId in class PofBufferWriternVersionId - the user type identifier; must be non-negative
public PofWriter createNestedPofWriter(int iProp)
throws java.io.IOException
createNestedPofWriter in interface PofWritercreateNestedPofWriter in class PofBufferWriteriProp - the property indexjava.io.IOException - if an I/O error occurs
public void writeRemainder(Binary binProps)
throws java.io.IOException
Calling this method terminates the current user type by writing a -1 to the POF stream after the last indexed property. Subsequent calls to the various writeXYZ methods of this interface will fail after this method is called.
writeRemainder in interface PofWriterwriteRemainder in class PofBufferWriterbinProps - a Binary object containing zero or more indexed properties in binary POF encoded form; may be nulljava.io.IOException - if an I/O error occursprotected PofBufferWriter getParentWriter()
getParentWriter in class PofBufferWriter
protected void beginProperty(int iProp)
throws java.io.IOException
This method call will be followed by one or more separate calls to a "write" method and the property extent will then be terminated by a call to PofBufferWriter.endProperty(int).
beginProperty in class PofBufferWriteriProp - the index of the property being writtenjava.io.IOException - if an I/O error occursprotected void endProperty(int iProp)
endProperty in class PofBufferWriteriProp - the index of the current propertyprotected void closeNested()
protected void onException(java.lang.Exception e)
throws java.io.IOException
If the given exception wraps an IOException, the IOException is unwrapped and rethrown; otherwise the given exception is rethrown.
onException in class PofBufferWritere - the exceptionjava.io.IOException - the wrapped IOException, if the given exception is a wrapped IOException
protected void writeUserTypeInfo()
throws java.io.IOException
java.io.IOException - on I/O errorpublic void enableReference()
enableReference in class PofBufferWriterprotected boolean isEvolvable()
isEvolvable in class PofBufferWriter
|
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 | |||||||