Package com.tangosol.run.xml
Interface XmlValue
- All Superinterfaces:
- Serializable
- All Known Subinterfaces:
- XmlDocument,- XmlElement
- All Known Implementing Classes:
- SimpleDocument,- SimpleElement,- SimpleValue
An interface for XML element content and element attribute values.
- Author:
- cp 2000.10.18
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates and returns a copy of this SimpleValue.booleanCompare this XML value with another XML value for equality.Get the value as binary.Get the value as binary.booleanGet the value as a boolean.booleangetBoolean(boolean fDefault) Get the value as a boolean.getDate()Get the value as a Date.Get the value as a Date.Get the value as a Timestamp.getDateTime(Timestamp dtDefault) Get the value as a Timestamp.Get the value as a decimal.getDecimal(BigDecimal decDefault) Get the value as a decimal.doubleGet the value as a double.doublegetDouble(double dflDefault) Get the value as a double.intgetInt()Get the value as an int.intgetInt(int nDefault) Get the value as an int.longgetLong()Get the value as a long.longgetLong(long lDefault) Get the value as a long.Get the parent element of this value.Get the value as a String.Get the value as a String.getTime()Get the value as a Time.Get the value as a Time.getValue()Get the value as an Object.inthashCode()Provide a hash value for this XML value.booleanDetermine if this value is an element attribute.booleanDetermine if this value is an element's content.booleanisEmpty()Determine if the value is empty.booleanDetermine if this value can be modified.voidSet the binary value.voidsetBoolean(boolean fVal) Set the boolean value.voidSet the Date value.voidsetDateTime(Timestamp dtVal) Set the Timestamp value.voidsetDecimal(BigDecimal decVal) Set the dcimal value.voidsetDouble(double dflVal) Set the double value.voidsetInt(int nVal) Set the int value.voidsetLong(long lVal) Set the long value.voidsetParent(XmlElement element) Set the parent element of this value.voidSet the String value.voidSet the Time value.toString()Format the XML value into a String in a display format.voidwriteValue(PrintWriter out, boolean fPretty) Write the value as it will appear in XML.
- 
Field Details- 
TYPE_BOOLEANstatic final int TYPE_BOOLEAN- See Also:
 
- 
TYPE_INTstatic final int TYPE_INT- See Also:
 
- 
TYPE_LONGstatic final int TYPE_LONG- See Also:
 
- 
TYPE_DOUBLEstatic final int TYPE_DOUBLE- See Also:
 
- 
TYPE_DECIMALstatic final int TYPE_DECIMAL- See Also:
 
- 
TYPE_STRINGstatic final int TYPE_STRING- See Also:
 
- 
TYPE_BINARYstatic final int TYPE_BINARY- See Also:
 
- 
TYPE_DATEstatic final int TYPE_DATE- See Also:
 
- 
TYPE_TIMEstatic final int TYPE_TIME- See Also:
 
- 
TYPE_DATETIMEstatic final int TYPE_DATETIME- See Also:
 
 
- 
- 
Method Details- 
getBooleanboolean getBoolean()Get the value as a boolean.- Returns:
- the value as a boolean
 
- 
setBooleanvoid setBoolean(boolean fVal) Set the boolean value.- Parameters:
- fVal- a new value of type boolean
 
- 
getIntint getInt()Get the value as an int.- Returns:
- the value as an int
 
- 
setIntvoid setInt(int nVal) Set the int value.- Parameters:
- nVal- a new value of type int
 
- 
getLonglong getLong()Get the value as a long.- Returns:
- the value as a long
 
- 
setLongvoid setLong(long lVal) Set the long value.- Parameters:
- lVal- a new value of type long
 
- 
getDoubledouble getDouble()Get the value as a double.- Returns:
- the value as a double
 
- 
setDoublevoid setDouble(double dflVal) Set the double value.- Parameters:
- dflVal- a new value of type double
 
- 
getDecimalBigDecimal getDecimal()Get the value as a decimal.- Returns:
- the value as a BigDecimal
 
- 
setDecimalSet the dcimal value.- Parameters:
- decVal- a new value of type BigDecimal
 
- 
getStringString getString()Get the value as a String.- Returns:
- the value as a String
 
- 
setStringSet the String value.- Parameters:
- sVal- a new value of type String
 
- 
getBinaryBinary getBinary()Get the value as binary. The XML format is expected to be Base64.- Returns:
- the value as a Binary object
 
- 
setBinarySet the binary value.- Parameters:
- binVal- a new value of type Binary
 
- 
getDateDate getDate()Get the value as a Date.- Returns:
- the value as a Date
 
- 
setDateSet the Date value.- Parameters:
- dtVal- a new value of type Date
 
- 
getTimeTime getTime()Get the value as a Time.- Returns:
- the value as a Time
 
- 
setTimeSet the Time value.- Parameters:
- dtVal- a new value of type Time
 
- 
getDateTimeTimestamp getDateTime()Get the value as a Timestamp.- Returns:
- the value as a Timestamp
 
- 
setDateTimeSet the Timestamp value.- Parameters:
- dtVal- a new value of type Timestamp
 
- 
getBooleanboolean getBoolean(boolean fDefault) Get the value as a boolean.- Parameters:
- fDefault- the default return value if the internal value can not be translated into a legal value of type boolean
- Returns:
- the value as a boolean
 
- 
getIntint getInt(int nDefault) Get the value as an int.- Parameters:
- nDefault- the default return value if the internal value can not be translated into a legal value of type int
- Returns:
- the value as an int
 
- 
getLonglong getLong(long lDefault) Get the value as a long.- Parameters:
- lDefault- the default return value if the internal value can not be translated into a legal value of type long
- Returns:
- the value as a long
 
- 
getDoubledouble getDouble(double dflDefault) Get the value as a double.- Parameters:
- dflDefault- the default return value if the internal value can not be translated into a legal value of type double
- Returns:
- the value as a double
 
- 
getDecimalGet the value as a decimal.- Parameters:
- decDefault- the default return value if the internal value can not be translated into a legal value of type decimal
- Returns:
- the value as a decimal
 
- 
getStringGet the value as a String.- Parameters:
- sDefault- the default return value if the internal value can not be translated into a legal value of type String
- Returns:
- the value as a String
 
- 
getBinaryGet the value as binary. The XML format is expected to be Base64.- Parameters:
- binDefault- the default return value if the internal value can not be translated into a legal value of type Binary
- Returns:
- the value as a Binary object
 
- 
getDateGet the value as a Date.- Parameters:
- dtDefault- the default return value if the internal value can not be translated into a legal value of type Date
- Returns:
- the value as a Date
 
- 
getTimeGet the value as a Time.- Parameters:
- dtDefault- the default return value if the internal value can not be translated into a legal value of type Time
- Returns:
- the value as a Time
 
- 
getDateTimeGet the value as a Timestamp.- Parameters:
- dtDefault- the default return value if the internal value can not be translated into a legal value of type Timestamp
- Returns:
- the value as a Timestamp
 
- 
getValueObject getValue()Get the value as an Object. The following types are supported: Boolean Integer Long Double BigDecimal String Binary Date Time Timestamp It is always legal for an implementation to return the value as a String, for example returning a binary value in a base64 encoding. This method exists to allow one value to copy from another value.- Returns:
- the value as an Object or null if the XmlValue does not have a value; attributes never have a null value
 
- 
getParentXmlElement getParent()Get the parent element of this value.- Returns:
- the parent element, or null if this value has no parent
 
- 
setParentSet the parent element of this value. The parent can not be modified once set.- Parameters:
- element- the parent element
- Throws:
- IllegalArgumentException- thrown if the specified parent is null
- IllegalStateException- throw if the parent is already set
 
- 
isEmptyboolean isEmpty()Determine if the value is empty.- Returns:
- true if the value is empty
 
- 
isAttributeboolean isAttribute()Determine if this value is an element attribute.- Returns:
- true if this value is an element attribute, otherwise false
 
- 
isContentboolean isContent()Determine if this value is an element's content.- Returns:
- true if this value is an element's content, otherwise false
 
- 
isMutableboolean isMutable()Determine if this value can be modified. If the value can not be modified, all mutating methods are required to throw an UnsupportedOperationException.- Returns:
- true if this value can be modified, otherwise false to indicate that this value is read-only
 
- 
writeValueWrite the value as it will appear in XML.- Parameters:
- out- a PrintWriter object to use to write to
- fPretty- true to specify that the output is intended to be as human readable as possible
 
- 
toStringString toString()Format the XML value into a String in a display format.
- 
hashCodeint hashCode()Provide a hash value for this XML value. The hash value is defined as one of the following:- 0 if getValue() returns null
- otherwise the hash value is the hashCode() of the string representation of the value
 
- 
equalsCompare this XML value with another XML value for equality.
- 
cloneObject clone()Creates and returns a copy of this SimpleValue. The returned copy is "unlinked" from the parent and mutable- Returns:
- a clone of this instance.
 
 
-