com.tc.object.dna.api
Interface DNAWriter


public interface DNAWriter


Method Summary
 void addArrayElementAction(int index, java.lang.Object value)
          Add physical action for array element change
 void addClassLoaderAction(java.lang.String classLoaderFieldName, java.lang.ClassLoader value)
          Add classloader action
 void addEntireArray(java.lang.Object value)
          Add physical action for entire array
 void addLiteralValue(java.lang.Object value)
          Add literal value
 void addLogicalAction(int method, java.lang.Object[] parameters)
          Add logical action to the writer
 void addPhysicalAction(java.lang.String fieldName, java.lang.Object value)
          Add physical action to the writer representing field value, automatically determine whether value is a reference by checking whether it is an ObjectID
 void addPhysicalAction(java.lang.String fieldName, java.lang.Object value, boolean canBeReference)
          Add physical action to the writer representing a field value, specify whether the value is a reference or not.
 void addSubArrayAction(int start, java.lang.Object array, int length)
          Add physical action for subarray change
 void copyTo(TCByteBufferOutput dest)
          Copy the written DNA data to the given output stream
 DNAWriter createAppender()
          create a DNAWriter for appending more actions to this DNA
 void finalizeHeader()
          Finalize the DNA header fields
 int getActionCount()
          Return the number of actions written so far in this writer
 boolean isContiguous()
          Is this DNA (including all appended actions) contiguous in memory
 void markSectionEnd()
          Indicate to this writer that no more actions will be added (must be called)
 void setArrayLength(int length)
          Set array length
 void setParentObjectID(ObjectID id)
          Set parent object ID for inner classes
 

Method Detail

addLogicalAction

void addLogicalAction(int method,
                      java.lang.Object[] parameters)
Add logical action to the writer

Parameters:
Method - identifier, defined in com.tc.object.SerializationUtil
parameters - Parameter values

addPhysicalAction

void addPhysicalAction(java.lang.String fieldName,
                       java.lang.Object value)
Add physical action to the writer representing field value, automatically determine whether value is a reference by checking whether it is an ObjectID

Parameters:
fieldName - The field name
value - The field value

addPhysicalAction

void addPhysicalAction(java.lang.String fieldName,
                       java.lang.Object value,
                       boolean canBeReference)
Add physical action to the writer representing a field value, specify whether the value is a reference or not.

Parameters:
fieldName - The field name
value - The field value
canBeReference - Is this a reference

addArrayElementAction

void addArrayElementAction(int index,
                           java.lang.Object value)
Add physical action for array element change

Parameters:
index - Index in the array
value - New value

addSubArrayAction

void addSubArrayAction(int start,
                       java.lang.Object array,
                       int length)
Add physical action for subarray change

Parameters:
start - Start index in the array
array - The array value
length - The length of the subarray

addClassLoaderAction

void addClassLoaderAction(java.lang.String classLoaderFieldName,
                          java.lang.ClassLoader value)
Add classloader action

Parameters:
classLoaderFieldName - Classloader field
value - Classloader

addEntireArray

void addEntireArray(java.lang.Object value)
Add physical action for entire array

Parameters:
value - Array value

addLiteralValue

void addLiteralValue(java.lang.Object value)
Add literal value

Parameters:
value - Literal value

finalizeHeader

void finalizeHeader()
Finalize the DNA header fields


setParentObjectID

void setParentObjectID(ObjectID id)
Set parent object ID for inner classes

Parameters:
id - Parent object ID

setArrayLength

void setArrayLength(int length)
Set array length

Parameters:
length - Length

getActionCount

int getActionCount()
Return the number of actions written so far in this writer


createAppender

DNAWriter createAppender()
create a DNAWriter for appending more actions to this DNA


isContiguous

boolean isContiguous()
Is this DNA (including all appended actions) contiguous in memory

Returns:
True if contiguous

markSectionEnd

void markSectionEnd()
Indicate to this writer that no more actions will be added (must be called)


copyTo

void copyTo(TCByteBufferOutput dest)
Copy the written DNA data to the given output stream

Parameters:
dest - The destination output stream


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.