Show / Hide Table of Contents

Interface IXmlValue

An interface for XML element content and element attribute values.

Inherited Members
ICloneable.Clone()
Namespace: Tangosol.Run.Xml
Assembly: Coherence.dll
Syntax
public interface IXmlValue : ICloneable

Properties

IsAttribute

Determine if this value is an element attribute.

Declaration
bool IsAttribute { get; }
Property Value
Type Description
bool

true if this value is an element attribute, otherwise false.

IsContent

Determine if this value is an element's content.

Declaration
bool IsContent { get; }
Property Value
Type Description
bool

true if this value is an element's content, otherwise false.

IsEmpty

Determine if the value is empty.

Declaration
bool IsEmpty { get; }
Property Value
Type Description
bool

true if the value is empty.

IsMutable

Determine if this value can be modified.

Declaration
bool IsMutable { get; }
Property Value
Type Description
bool

true if this value can be modified, otherwise false to indicate that this value is read-only.

Remarks

If the value can not be modified, all mutating methods are required to throw an InvalidOperationException.

Parent

Get or set the parent element of this value.

Declaration
IXmlElement Parent { get; set; }
Property Value
Type Description
IXmlElement

The parent element, or null if this value has no parent.

Remarks

The parent can not be modified once set.

Exceptions
Type Condition
ArgumentNullException

If the specified parent is null.

InvalidOperationException

If trying to set parent that is already set.

Value

Get the value as an object.

Declaration
object Value { get; }
Property Value
Type Description
object

The value as an object or null if the IXmlValue does not have a value; attributes never have a null value.

Remarks

The following types are supported:

  • Boolean
  • Integer
  • Long
  • Double
  • Decimal
  • String
  • Binary
  • DateTime
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.

Methods

Equals(object)

Compare this XML value with another XML value for equality.

Declaration
bool Equals(object o)
Parameters
Type Name Description
object o

The XML value object to compare to.

Returns
Type Description
bool

true if the values are equal, false otherwise.

GetBinary()

Get the value as Binary.

Declaration
Binary GetBinary()
Returns
Type Description
Binary

The value as a Binary object.

Remarks

The XML format is expected to be Base64.

GetBinary(Binary)

Get the value as Binary.

Declaration
Binary GetBinary(Binary defaultValue)
Parameters
Type Name Description
Binary defaultValue

The default return value if the internal value can not be translated into a legal value of type Binary.

Returns
Type Description
Binary

The value as a Binary object.

Remarks

The XML format is expected to be Base64.

GetBoolean()

Get the value as a boolean.

Declaration
bool GetBoolean()
Returns
Type Description
bool

The value as a boolean.

GetBoolean(bool)

Get the value as a boolean.

Declaration
bool GetBoolean(bool defaultValue)
Parameters
Type Name Description
bool defaultValue

The default return value if the internal value can not be translated into a legal value of type boolean.

Returns
Type Description
bool

The value as a boolean.

GetDateTime()

Get the value as a DateTime.

Declaration
DateTime GetDateTime()
Returns
Type Description
DateTime

The value as a DateTime.

GetDateTime(DateTime)

Get the value as a DateTime.

Declaration
DateTime GetDateTime(DateTime defaultValue)
Parameters
Type Name Description
DateTime defaultValue

The default return value if the internal value can not be translated into a legal value of type DateTime.

Returns
Type Description
DateTime

The value as a DateTime.

GetDecimal()

Get the value as a decimal.

Declaration
decimal GetDecimal()
Returns
Type Description
decimal

The value as a decimal.

GetDecimal(decimal)

Get the value as a decimal.

Declaration
decimal GetDecimal(decimal defaultValue)
Parameters
Type Name Description
decimal defaultValue

The default return value if the internal value can not be translated into a legal value of type decimal.

Returns
Type Description
decimal

The value as a decimal.

GetDouble()

Get the value as a double.

Declaration
double GetDouble()
Returns
Type Description
double

The value as a double.

GetDouble(double)

Get the value as a double.

Declaration
double GetDouble(double defaultValue)
Parameters
Type Name Description
double defaultValue

The default return value if the internal value can not be translated into a legal value of type double.

Returns
Type Description
double

The value as a double.

GetHashCode()

Provide a hash value for this XML value.

Declaration
int GetHashCode()
Returns
Type Description
int

The hash value for this XML value.

Remarks

The hash value is defined as one of the following:

  1. 0 if Value is null
  2. otherwise the hash value is the GetHashCode() of the string representation of the value

GetInt()

Get the value as an int.

Declaration
int GetInt()
Returns
Type Description
int

The value as an int.

GetInt(int)

Get the value as an int.

Declaration
int GetInt(int defaultValue)
Parameters
Type Name Description
int defaultValue

The default return value if the internal value can not be translated into a legal value of type int.

Returns
Type Description
int

The value as an int.

GetLong()

Get the value as a long.

Declaration
long GetLong()
Returns
Type Description
long

The value as a long.

GetLong(long)

Get the value as a long.

Declaration
long GetLong(long defaultValue)
Parameters
Type Name Description
long defaultValue

The default return value if the internal value can not be translated into a legal value of type long.

Returns
Type Description
long

The value as a long.

GetString()

Get the value as a string.

Declaration
string GetString()
Returns
Type Description
string

The value as a string.

GetString(string)

Get the value as a string.

Declaration
string GetString(string defaultValue)
Parameters
Type Name Description
string defaultValue

The default return value if the internal value can not be translated into a legal value of type string.

Returns
Type Description
string

The value as a string.

SetBinary(Binary)

Set the Binary value.

Declaration
void SetBinary(Binary val)
Parameters
Type Name Description
Binary val

A new value of type Binary.

SetBoolean(bool)

Set the boolean value.

Declaration
void SetBoolean(bool val)
Parameters
Type Name Description
bool val

A new value of type boolean.

SetDateTime(DateTime)

Set the value as a DateTime.

Declaration
void SetDateTime(DateTime val)
Parameters
Type Name Description
DateTime val

A new value of type DateTime.

SetDecimal(decimal)

Set the decimal value.

Declaration
void SetDecimal(decimal val)
Parameters
Type Name Description
decimal val

A new value of type decimal.

SetDouble(double)

Set the double value.

Declaration
void SetDouble(double val)
Parameters
Type Name Description
double val

A new value of type double.

SetInt(int)

Set the int value.

Declaration
void SetInt(int val)
Parameters
Type Name Description
int val

A new value of type int.

SetLong(long)

Set the long value.

Declaration
void SetLong(long val)
Parameters
Type Name Description
long val

A new value of type long.

SetString(string)

Set the string value.

Declaration
void SetString(string val)
Parameters
Type Name Description
string val

A new value of type string.

ToString()

Format the XML value into a string in a display format.

Declaration
string ToString()
Returns
Type Description
string

A string representation of the XML value.

WriteValue(TextWriter, bool)

Write the value as it will appear in XML.

Declaration
void WriteValue(TextWriter writer, bool isPretty)
Parameters
Type Name Description
TextWriter writer

A TextWriter object to use to write to.

bool isPretty

true to specify that the output is intended to be as human readable as possible.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.