public class SimpleValue extends ExternalizableHelper implements XmlValue, Cloneable, ExternalizableLite, PortableObject
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
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
LOG_ALWAYS, LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_MAX, LOG_MIN, LOG_QUIET, LOG_WARN, POWER_0, POWER_G, POWER_K, POWER_M, POWER_T, UNIT_D, UNIT_H, UNIT_M, UNIT_MS, UNIT_NS, UNIT_S, UNIT_US
TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATETIME, TYPE_DECIMAL, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_STRING, TYPE_TIME
Constructor and Description |
---|
SimpleValue()
Construct an empty SimpleValue.
|
SimpleValue(Object oValue)
Construct a SimpleValue.
|
SimpleValue(Object oValue,
boolean fAttribute)
Construct a SimpleValue.
|
SimpleValue(Object oValue,
boolean fAttribute,
boolean fReadOnly)
Construct a SimpleValue.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates and returns a copy of this SimpleValue.
|
protected Object |
convert(Object o,
int nType)
Convert the passed Object to the specified type.
|
protected Object |
ensureType(int nType)
Change the type of the internal representation of the XmlValue.
|
boolean |
equals(Object o)
Compare this XML value with another XML value for equality.
|
Binary |
getBinary()
Get the value as binary.
|
Binary |
getBinary(Binary binDefault)
Get the value as binary.
|
boolean |
getBoolean()
Get the value as a boolean.
|
boolean |
getBoolean(boolean fDefault)
Get the value as a boolean.
|
Date |
getDate()
Get the value as a Date.
|
Date |
getDate(Date dtDefault)
Get the value as a Date.
|
Timestamp |
getDateTime()
Get the value as a Timestamp.
|
Timestamp |
getDateTime(Timestamp dtDefault)
Get the value as a Timestamp.
|
BigDecimal |
getDecimal()
Get the value as a decimal.
|
BigDecimal |
getDecimal(BigDecimal decDefault)
Get the value as a decimal.
|
double |
getDouble()
Get the value as a double.
|
double |
getDouble(double dflDefault)
Get the value as a double.
|
int |
getInt()
Get the value as an int.
|
int |
getInt(int nDefault)
Get the value as an int.
|
protected Object |
getInternalValue()
Get the internal value of this XmlValue.
|
long |
getLong()
Get the value as a long.
|
long |
getLong(long lDefault)
Get the value as a long.
|
XmlElement |
getParent()
Get the parent element of this element.
|
String |
getString()
Get the value as a String.
|
String |
getString(String sDefault)
Get the value as a String.
|
Time |
getTime()
Get the value as a Time.
|
Time |
getTime(Time dtDefault)
Get the value as a Time.
|
Object |
getValue()
Get the value as an Object.
|
int |
hashCode()
Provide a hash value for this XML value.
|
boolean |
isAttribute()
Determine if this value is an element attribute.
|
boolean |
isContent()
Determine if this value is an element's content.
|
boolean |
isEmpty()
Determine if the value is empty.
|
boolean |
isMutable()
Determine if this value can be modified.
|
void |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from
the passed DataInput object.
|
void |
readExternal(PofReader in)
Restore the contents of a user type instance by reading its state using
the specified PofReader object.
|
protected void |
setAttribute(boolean fAttribute)
Specify that this value is an element attribute.
|
void |
setBinary(Binary binVal)
Set the binary value.
|
void |
setBoolean(boolean fVal)
Set the boolean value.
|
void |
setDate(Date dtVal)
Set the Date value.
|
void |
setDateTime(Timestamp dtVal)
Set the Timestamp value.
|
void |
setDecimal(BigDecimal decVal)
Set the dcimal value.
|
void |
setDouble(double dflVal)
Set the double value.
|
void |
setInt(int nVal)
Set the int value.
|
protected void |
setInternalValue(Object oValue)
Update the internal representation of the XmlValue.
|
void |
setLong(long lVal)
Set the long value.
|
protected void |
setMutable(boolean fMutable)
Specify whether this value can be modified or not.
|
void |
setParent(XmlElement element)
Set the parent element of this value.
|
void |
setString(String sVal)
Set the String value.
|
void |
setTime(Time dtVal)
Set the Time value.
|
String |
toString()
Format the XML value into a String in a display format.
|
void |
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into
the passed DataOutput object.
|
void |
writeExternal(PofWriter out)
Save the contents of a POF user type instance by writing its state using
the specified PofWriter object.
|
void |
writeValue(PrintWriter out,
boolean fPretty)
Write the value as it will appear in XML.
|
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
public SimpleValue()
public SimpleValue(Object oValue)
oValue
- the initial value for this SimpleValueIllegalArgumentException
- if the String value is illegalpublic SimpleValue(Object oValue, boolean fAttribute)
oValue
- the initial value for this SimpleValuefAttribute
- true if this SimpleValue is an element attribute
value; false if an element's content's valueIllegalArgumentException
- if the String value is illegalpublic SimpleValue(Object oValue, boolean fAttribute, boolean fReadOnly)
oValue
- the initial value for this SimpleValuefAttribute
- true if this SimpleValue is an element attribute
value; false if an element's content's valuefReadOnly
- true if this SimpleValue is intended to be read-
only once the constructor has finishedIllegalArgumentException
- if the String value is illegalpublic boolean getBoolean()
getBoolean
in interface XmlValue
public boolean getBoolean(boolean fDefault)
getBoolean
in interface XmlValue
fDefault
- the default return value if the internal value can
not be translated into a legal value of type booleanpublic void setBoolean(boolean fVal)
setBoolean
in interface XmlValue
fVal
- a new value of type booleanpublic int getInt()
public int getInt(int nDefault)
public void setInt(int nVal)
public long getLong()
public long getLong(long lDefault)
public void setLong(long lVal)
public double getDouble()
public double getDouble(double dflDefault)
public void setDouble(double dflVal)
public BigDecimal getDecimal()
getDecimal
in interface XmlValue
public BigDecimal getDecimal(BigDecimal decDefault)
getDecimal
in interface XmlValue
decDefault
- the default return value if the internal value can
not be translated into a legal value of type decimalpublic void setDecimal(BigDecimal decVal)
setDecimal
in interface XmlValue
decVal
- a new value of type BigDecimalpublic String getString()
public void setString(String sVal)
setString
in interface XmlValue
sVal
- a new value of type StringIllegalArgumentException
- if the String value is nullpublic Binary getBinary()
public Binary getBinary(Binary binDefault)
public void setBinary(Binary binVal)
setBinary
in interface XmlValue
binVal
- a new value of type BinaryIllegalArgumentException
- if the binary value is nullpublic Date getDate()
public void setDate(Date dtVal)
public Time getTime()
public void setTime(Time dtVal)
public Timestamp getDateTime()
getDateTime
in interface XmlValue
public Timestamp getDateTime(Timestamp dtDefault)
getDateTime
in interface XmlValue
dtDefault
- the default return value if the internal value can
not be translated into a legal value of type Timestamppublic void setDateTime(Timestamp dtVal)
setDateTime
in interface XmlValue
dtVal
- a new value of type Timestamppublic Object getValue()
public XmlElement getParent()
public void setParent(XmlElement element)
setParent
in interface XmlValue
element
- the parent elementIllegalArgumentException
- thrown if the specified parent is nullIllegalStateException
- throw if the parent is already setpublic boolean isEmpty()
public boolean isAttribute()
isAttribute
in interface XmlValue
public boolean isContent()
public boolean isMutable()
public void writeValue(PrintWriter out, boolean fPretty)
writeValue
in interface XmlValue
out
- a PrintWriter object to use to write tofPretty
- true to specify that the output is intended to be as
human readable as possiblepublic void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore
the state of this objectIOException
- if an I/O exception occursNotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object toIOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws IOException
readExternal
in interface PortableObject
in
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws IOException
writeExternal
in interface PortableObject
out
- the PofWriter to which to write the object's stateIOException
- if an I/O error occursprotected Object getInternalValue()
protected void setInternalValue(Object oValue)
oValue
- the new value for this SimpleValue objectUnsupportedOperationException
- if this XmlValue is not mutableprotected Object ensureType(int nType)
nType
- the enumerated type to convert toprotected Object convert(Object o, int nType)
o
- the object valuenType
- the enumerated type to convert toprotected void setAttribute(boolean fAttribute)
fAttribute
- true if this value is an element attribute, false if
this value is an element's contentprotected void setMutable(boolean fMutable)
fMutable
- pass true to allow this value to be modified,
otherwise false to indicate that this value is
read-onlypublic String toString()
public int hashCode()
public boolean equals(Object o)