|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.UserTypeWriter |
Nested classes/interfaces inherited from class com.tangosol.io.pof.PofHelper |
---|
PofHelper.ReadableEntrySetMap, PofHelper.WriteableEntrySetMap |
Field Summary | |
---|---|
protected WritingPofHandler.Complex |
m_complex
The Complex value that corresponds to the user type that is being written. |
protected boolean |
m_fUserTypeBegin
True iff the type and version identifier of the user type was written to the POF stream. |
protected boolean |
m_fUserTypeEnd
True iff the user type was written to the POF stream. |
protected int |
m_iPrevProp
The index of the last property written to the POF stream or -1 if the first property has yet to be written. |
protected int |
m_iProp
The index of the user type being written. |
protected int |
m_nTypeId
The type identifier of the user type that is being written. |
protected int |
m_nVersionId
The version identifier of the user type that is being written. |
Fields inherited from class com.tangosol.io.pof.PofBufferWriter |
---|
m_ctx, m_handler, m_out |
Fields inherited from class com.tangosol.io.pof.PofHelper |
---|
BIGDECIMAL_ZERO, 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(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 |
endProperty(int iProp)
Signifies the termination of the current POF property. |
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 |
writeObject(int iProp,
Object o)
Write an Object property to the POF stream. The given object must be an instance of one of the following:
PofSerializer for the object must be obtainable from
the PofContext associated with this PofWriter. |
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. 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_iPrevProp
protected boolean m_fUserTypeBegin
protected boolean m_fUserTypeEnd
protected WritingPofHandler.Complex m_complex
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 writtenpublic 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 writtenMethod Detail |
---|
public void writeObject(int iProp, Object o) throws IOException
RawQuad
Binary
RawDate
RawTime
RawDateTime
RawYearMonthInterval
RawTimeInterval
RawDayTimeInterval
LongArray
PortableObject
PofSerializer
for the object must be obtainable from
the PofContext
associated with this PofWriter.
writeObject
in interface PofWriter
writeObject
in class PofBufferWriter
iProp
- the property indexo
- the Object property to write
IOException
- if an I/O error occurspublic int getUserTypeId()
getUserTypeId
in interface PofWriter
getUserTypeId
in class PofBufferWriter
public int getVersionId()
getVersionId
in interface PofWriter
getVersionId
in class PofBufferWriter
public void setVersionId(int nVersionId)
setVersionId
in interface PofWriter
setVersionId
in class PofBufferWriter
nVersionId
- the user type identifier; must be non-negativepublic void writeRemainder(Binary binProps) throws IOException
writeRemainder
in interface PofWriter
writeRemainder
in class PofBufferWriter
binProps
- a Binary object containing zero or more indexed
properties in binary POF encoded form; may be null
IOException
- if an I/O error occursprotected void beginProperty(int iProp) throws IOException
PofBufferWriter.endProperty(int)
.
beginProperty
in class PofBufferWriter
iProp
- the index of the property being written
IOException
- if an I/O error occursprotected void endProperty(int iProp)
endProperty
in class PofBufferWriter
iProp
- the index of the current propertyprotected void onException(Exception e) throws IOException
onException
in class PofBufferWriter
e
- the exception
IOException
- the wrapped IOException, if the given exception is
a wrapped IOExceptionprotected void writeUserTypeInfo() throws IOException
IOException
- on I/O error
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |