public abstract class AbstractPofValue extends ExternalizableHelper implements PofValue
ExternalizableHelper.DecoratedMultiBufferReadBuffer, ExternalizableHelper.DefaultObjectStreamFactory, ExternalizableHelper.FormatAwareCompressor, ExternalizableHelper.IntDecoratedObject, ExternalizableHelper.Shielded, ExternalizableHelper.ShieldedDataOutputStream, ExternalizableHelper.ShieldedInputStream, ExternalizableHelper.ShieldedObjectOutputStream, ExternalizableHelper.ShieldedOutputStream, ExternalizableHelper.SimpleXmlBeanClassCache, ExternalizableHelper.Stats, ExternalizableHelper.XmlBeanClassCache
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected LongArray |
m_arrayRefs
Lazily-constructed mapping of identities to references.
|
protected int |
m_nType
POF type identifer of this value.
|
protected Object |
m_oValue
Deserialized representation of this value.
|
CONVERTER_FROM_BINARY, CONVERTER_STRIP_INTDECO, CONVERTER_TO_BINARY, DECO_APP_1, DECO_APP_2, DECO_APP_3, DECO_CUSTOM, DECO_EXPIRY, DECO_ID_MAX, DECO_ID_MIN, DECO_JCACHE, DECO_JCACHE_SYNTHETIC, DECO_MEMCACHED, DECO_PUSHREP, DECO_QUEUE_METADATA, DECO_RSVD_1, DECO_RSVD_2, DECO_STORE, DECO_TX, DECO_VALUE, DECO_WLS, EMPTY_BINARY_ARRAY, FMT_B_ARRAY, FMT_BIN_DECO, FMT_BIN_EXT_DECO, FMT_BINARY, FMT_BOOLEAN, FMT_BYTE, FMT_DECIMAL, FMT_DOUBLE, FMT_EXT, FMT_FLOAT, FMT_IDO, FMT_INT, FMT_INTEGER, FMT_LONG, FMT_NONE, FMT_NULL, FMT_OBJ_EXT, FMT_OBJ_SER, FMT_OPT, FMT_OPT_DOUBLE, FMT_OPT_INT, FMT_OPT_LONG, FMT_SHORT, FMT_STRING, FMT_UNKNOWN, FMT_XML_BEAN, FMT_XML_SER, FORCE_RESOLVING_STREAMS, MAX_DECO_HEADER_BYTES, PROPERTY_CONFIG, s_streamfactory, TRINT_DOMAIN_SPAN, TRINT_MAX_VALUE, TRINT_MAX_VARIANCE, USE_POF_STREAMS, USE_XMLBEAN_CLASS_CACHE, XMLBEAN_CLASS_CACHE
Constructor and Description |
---|
AbstractPofValue(PofValue valueParent,
ReadBuffer bufValue,
PofContext ctx,
int of,
int nType)
Construct a PofValue instance wrapping the supplied buffer.
|
Modifier and Type | Method and Description |
---|---|
Binary |
applyChanges()
Apply all the changes that were made to this value and return a binary
representation of the new value.
|
protected LongArray |
ensureReferenceRegistry()
Obtain the registry for identity-reference pairs, creating it if
necessary.
|
BigDecimal |
getBigDecimal()
Return the BigDecimal which this PofValue represents.
|
BigInteger |
getBigInteger()
Return the BigInteger which this PofValue represents.
|
boolean |
getBoolean()
Return the boolean which this PofValue represents.
|
boolean[] |
getBooleanArray()
Return the boolean[] which this PofValue represents.
|
byte |
getByte()
Return the byte which this PofValue represents.
|
byte[] |
getByteArray()
Return the byte[] which this PofValue represents.
|
ReadBuffer |
getChanges()
Return a buffer containing changes made to this PofValue in the format
defined by the
BinaryDeltaCompressor . |
char |
getChar()
Return the char which this PofValue represents.
|
char[] |
getCharArray()
Return the char[] which this PofValue represents.
|
Collection |
getCollection(Collection coll)
Return the Collection which this PofValue represents.
|
Date |
getDate()
Return the Date which this PofValue represents.
|
protected int |
getDirtyBytesCount()
Get the estimated number of dirty bytes in this POF value hierarchy.
|
double |
getDouble()
Return the double which this PofValue represents.
|
double[] |
getDoubleArray()
Return the double[] which this PofValue represents.
|
float |
getFloat()
Return the float which this PofValue represents.
|
float[] |
getFloatArray()
Return the float[] which this PofValue represents.
|
int |
getInt()
Return the int which this PofValue represents.
|
int[] |
getIntArray()
Return the int[] which this PofValue represents.
|
long |
getLong()
Return the long which this PofValue represents.
|
long[] |
getLongArray()
Return the long[] which this PofValue represents.
|
Map |
getMap(Map map)
Return the Map which this PofValue represents.
|
Object[] |
getObjectArray()
Return the Object[] which this PofValue represents.
|
int |
getOffset()
Return the offset of this value from the beginning of POF stream.
|
protected ReadBuffer |
getOriginalBuffer()
Get the original buffer the changes should be applied to.
|
PofValue |
getParent()
Return the parent of this value.
|
PofContext |
getPofContext()
Return the POF context to use for serialization and deserialization.
|
protected int |
getPropertyIndex() |
PofValue |
getRoot()
Return the root of the hierarchy this value belongs to.
|
ReadBuffer |
getSerializedValue()
Return this value's serialized form.
|
short |
getShort()
Return the short which this PofValue represents.
|
short[] |
getShortArray()
Return the short[] which this PofValue represents.
|
int |
getSize()
Return the size of the encoded value in bytes.
|
String |
getString()
Return the String which this PofValue represents.
|
int |
getTypeId()
Obtain the POF type identifier for this value.
|
Object |
getValue()
Return the deserialized value which this PofValue represents.
|
Object |
getValue(Class clz)
Return the deserialized value which this PofValue represents.
|
Object |
getValue(int nType)
Return the deserialized value which this PofValue represents.
|
protected ReadBuffer |
getValueBuffer()
Get the raw value buffer.
|
protected void |
incrementDirtyBytesCount(int cb)
Increment the counter representing the estimated number of bytes in the
original buffer that have been modified.
|
protected void |
incrementDirtyValuesCount()
Increment the counter representing the number of values within this POF
hierarchy that have been modified.
|
boolean |
isDirty()
Return true if this value has been modified,
false otherwise.
|
protected boolean |
isRoot()
Return true if this instance is the root of the PofValue
hierarchy.
|
protected boolean |
isUniformEncoded()
Return true if the buffer contains only the value, without the
type identifier.
|
protected PofValue |
lookupIdentity(int nId)
Look up the specified identity and return the PofValue to which it
refers.
|
protected void |
registerIdentity(int nId,
Object oValue)
Register the passed value with the passed identity.
|
protected void |
setDecorations(long nDecoMask,
ReadBuffer bufDeco)
Set the decoration mask and decorations for the PofValue.
|
protected void |
setDirty()
Set the dirty flag for this value.
|
protected void |
setOriginalBuffer(ReadBuffer bufValue)
Set the original buffer the changes should be applied to.
|
protected void |
setUniformEncoded()
Specifies that the buffer contains only a value, without a type identifier.
|
void |
setValue(Object oValue)
Update this PofValue.
|
asBinary, calculatePackedLength, calculatePackedLength, checkObjectInputFilter, convertUTF, decodeExpiry, decorate, decorate, decorate, decorate, decorate, decorateBinary, encodeExpiry, ensureSerializer, extractIntDecoration, fromBinary, fromBinary, fromBinary, fromBinary, fromBinary, fromBinary, fromByteArray, fromByteArray, getClass, getDecoration, getDecoration, getDecorations, getDeltaCompressor, getInputStream, getNewObjectInput, getObjectInput, getObjectOutput, getObjectStreamFactory, getOutputStream, getShieldedOutputStream, getStreamFormat, getUndecorated, getUndecorated, isDecorated, isDecorated, isIntDecorated, isIntDecorated, isResolving, isSerializable, isSerializerCompatible, isVersionCompatible, isVersionCompatible, loadClass, loadResource, main, makeTrint, readBigDecimal, readBigInteger, readBooleanArray, readByteArray, readCollection, readDate, readDoubleArray, readExternalizableLite, readExternalizableLite, readFloatArray, readInt, readInt, readIntArray2d, readLong, readLong, readMap, readMap, readObject, readObject, readSafeUTF, readSafeUTF, readSerializable, readSerializable, readStringArray, readTime, readTimestamp, readTrint, readUnsignedTrint, readUTF, readXmlBean, readXmlSerializable, readXmlSerializable, realize, removeIntDecoration, removeIntDecoration, replace, reportIncompatibleSerializers, setObjectStreamFactory, toBinary, toBinary, toByteArray, toByteArray, toByteArray, toLiteBinary, toLong, undecorate, undecorate, validateBufferSize, writeBigDecimal, writeBigInteger, writeBooleanArray, writeByteArray, writeCollection, writeDate, writeDoubleArray, writeExternalizableLite, writeFloatArray, writeInt, writeInt, writeIntArray2d, writeLong, writeLong, writeMap, writeObject, writeSafeUTF, writeSafeUTF, writeSerializable, writeStringArray, writeTime, writeTimestamp, writeTrint, writeTrint, writeUTF, writeXmlBean, writeXmlSerializable
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
protected LongArray m_arrayRefs
protected int m_nType
protected Object m_oValue
public AbstractPofValue(PofValue valueParent, ReadBuffer bufValue, PofContext ctx, int of, int nType)
valueParent
- parent value within the POF streambufValue
- buffer containing POF representation of this valuectx
- POF context to use when reading or writing propertiesof
- offset of this value from the beginning of POF streamnType
- POF type identifier for this valuepublic int getTypeId()
public PofValue getRoot()
public PofValue getParent()
public Object getValue()
Note: For primitive types such as int or boolean, the POF type
is not stored in the POF stream. Therefore, for primitive types, the
type or class must be explicitly specified via PofValue.getValue(int)
or PofValue.getValue(Class)
.
public Object getValue(Class clz)
Note: For primitive types such as int or boolean, the POF type is not stored in the POF stream. Therefore, for primitive types, the clz parameter must not be null.
public Object getValue(int nType)
Note: For primitive types such as int or boolean, the POF type is not stored in the POF stream. Therefore, for primitive types, the type must be explicitly specified with the nType parameter.
getValue
in interface PofValue
nType
- the required POF type of the returned value or
PofConstants.T_UNKNOWN
if the type is to be
inferred from the serialized statepublic void setValue(Object oValue)
The changes made using this method will be immediately reflected in the
result of PofValue.getValue()
method, but will not be applied to the
underlying POF stream until the PofValue.applyChanges()
method is invoked
on the root PofValue.
public Binary applyChanges()
Any format prefixes and/or decorations that were present in the original buffer this value orginated from will be preserved.
Note: this method can only be called on the root PofValue.
applyChanges
in interface PofValue
public ReadBuffer getChanges()
BinaryDeltaCompressor
.
Note: this method can only be called on the root PofValue
getChanges
in interface PofValue
public boolean getBoolean()
getBoolean
in interface PofValue
public byte getByte()
public char getChar()
public short getShort()
public int getInt()
public long getLong()
public float getFloat()
public double getDouble()
public boolean[] getBooleanArray()
getBooleanArray
in interface PofValue
public byte[] getByteArray()
getByteArray
in interface PofValue
public char[] getCharArray()
getCharArray
in interface PofValue
public short[] getShortArray()
getShortArray
in interface PofValue
public int[] getIntArray()
getIntArray
in interface PofValue
public long[] getLongArray()
getLongArray
in interface PofValue
public float[] getFloatArray()
getFloatArray
in interface PofValue
public double[] getDoubleArray()
getDoubleArray
in interface PofValue
public BigInteger getBigInteger()
getBigInteger
in interface PofValue
public BigDecimal getBigDecimal()
getBigDecimal
in interface PofValue
public String getString()
public Date getDate()
public Object[] getObjectArray()
getObjectArray
in interface PofValue
public Collection getCollection(Collection coll)
getCollection
in interface PofValue
coll
- the optional Collection to use to store the valuespublic PofContext getPofContext()
public int getOffset()
public int getSize()
public boolean isDirty()
protected void setDirty()
public ReadBuffer getSerializedValue()
protected int getPropertyIndex()
protected ReadBuffer getOriginalBuffer()
protected void setOriginalBuffer(ReadBuffer bufValue)
bufValue
- buffer containing the original valueprotected LongArray ensureReferenceRegistry()
protected void registerIdentity(int nId, Object oValue)
nId
- the identity within the POF stream of the objectoValue
- the object to associate with the passed identityIllegalArgumentException
- if the specified identity is already
registered with a different objectprotected PofValue lookupIdentity(int nId) throws IOException
nId
- the identityIOException
- if the requested identity is not registeredprotected ReadBuffer getValueBuffer()
protected void setDecorations(long nDecoMask, ReadBuffer bufDeco)
nDecoMask
- decoration identifiers bit maskbufDeco
- buffer containing the decorationsprotected boolean isRoot()
protected boolean isUniformEncoded()
protected void setUniformEncoded()
protected int getDirtyBytesCount()
protected void incrementDirtyValuesCount()
protected void incrementDirtyBytesCount(int cb)
cb
- the number of bytes to increment counter for