|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-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_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. The returned PofWriter is only valid from the time that it is returned until the next call is made to this PofWriter. |
void |
enableReferences()Ensure that references (support for cyclic dependencies) are 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 void |
onException(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. As part of writing out a user type, this method must be called by the PofSerializer that is writing out the user type, or the POF stream will be corrupted. <p/> 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. |
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 IOException
createNestedPofWriter in interface PofWritercreateNestedPofWriter in class PofBufferWriteriProp - the property indexIOException - if an I/O error occurs
public void writeRemainder(Binary binProps)
throws IOException
writeRemainder in interface PofWriterwriteRemainder in class PofBufferWriterbinProps - a Binary object containing zero or more indexed properties in binary POF encoded form; may be nullIOException - if an I/O error occursprotected PofBufferWriter getParentWriter()
getParentWriter in class PofBufferWriter
protected void beginProperty(int iProp)
throws IOException
PofBufferWriter.endProperty(int).beginProperty in class PofBufferWriteriProp - the index of the property being writtenIOException - 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(Exception e)
throws IOException
onException in class PofBufferWritere - the exceptionIOException - the wrapped IOException, if the given exception is a wrapped IOException
protected void writeUserTypeInfo()
throws IOException
IOException - on I/O errorpublic void enableReferences()
enableReferences in class PofBufferWriter
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||