Oracle Coherence for C++ API
Release 3.6.1.0
E18813-01

- Main Page
- Namespaces
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# XmlValue Class Reference

`#include <coherence/run/xml/XmlValue.hpp>`

Inherits Object.

Inherited by XmlElement `[virtual]`.

List of all members.

## Detailed Description

An interface for XML element content and element attribute values.

Author:
  tb 2007.12.12

## Public Types
typedef spec::Handle | Handle
| XmlValue Handle definition.
typedef spec::View | View
| XmlValue View definition.
typedef spec::Holder | Holder
| XmlValue Holder definition.
## Public Member Functions
virtual bool | getBoolean (bool fDefault=false) const =0
| Get the value as a bool.
virtual void | setBoolean (bool fValue)=0
| Set the value as a bool.
virtual int32_t | getInt32 (int32_t nDefault=0) const =0
| Get the value as an integer.
virtual void | setInt32 (int32_t nValue)=0
| Set the integer value.
virtual String::View | getString (String::View vsDefault="") const =0
| Get the value as a String.
virtual void | setString (String::View vsValue)=0
| Set the String value.
virtual Object::View | getValue () const =0
| Get the value as an Object.
virtual TypedHandle < XmlElement > | getParent ()=0
| Get the parent element of this value.
virtual TypedHandle < const XmlElement > | getParent () const =0
| Get the parent element of this value as a view.
virtual void | setParent (TypedHandle< XmlElement > hElement)=0
| Set the parent element of this value.
virtual bool | isEmpty () const =0
| Determine if the value is empty.
virtual bool | isAttribute () const =0
| Determine if this value is an element attribute.
virtual bool | isContent () const =0
| Determine if this value is an element's content.
virtual void | writeValue (std::ostream &out) const =0
| Write the value as XML.

## Member Function Documentation

virtual bool getBoolean | ( | bool | fDefault = `false` | ) | const `[pure virtual]`

Get the value as a bool.

If the internal value cannot be translated into a bool, the supplied default value is returned.

Parameters:

  | fDefault | the default return value

Returns:
  the value as a bool or the default value

virtual void setBoolean | ( | bool | fValue | ) | `[pure virtual]`

Set the value as a bool.

Parameters:

  | fValue | a new value of type bool

virtual int32_t getInt32 | ( | int32_t | nDefault = `0` | ) | const `[pure virtual]`

Get the value as an integer.

If the internal value cannot be translated into int32_t, the supplied default value is returned.

Parameters:

  | nDefault | the default return value

Returns:
  the value as int32_t or the default value

virtual void setInt32 | ( | int32_t | nValue | ) | `[pure virtual]`

Set the integer value.

Parameters:

  | nValue | a new value of type int32_t

virtual String::View getString | ( | String::View | vsDefault = `""` | ) | const `[pure virtual]`

Get the value as a String.

If the internal value cannot be translated into a String, the supplied default value is returned.

Parameters:

  | vsDefault | the default return value

Returns:
  the value as a String or the default value

virtual void setString | ( | String::View | vsValue | ) | `[pure virtual]`

Set the String value.

Parameters:

  | vsValue | a new value of type String

virtual Object::View getValue | ( |  | ) | const `[pure virtual]`

Get the value as an Object.

The following types are supported:

- coherence::lang::Boolean
- coherence::lang::Integer32
- coherence::lang::String

It is always legal for an implementation to return the value as a String.

Returns:
  the value as an Object or NULL if the XmlValue does not have a value; attributes never have a NULL value

virtual TypedHandle<XmlElement> getParent | ( |  | ) | `[pure virtual]`

Get the parent element of this value.

Returns:
  the parent element, or NULL if this value has no parent

virtual TypedHandle<const XmlElement> getParent | ( |  | ) | const `[pure virtual]`

Get the parent element of this value as a view.

Returns:
  the parent element, or NULL if this value has no parent

virtual void setParent | ( | TypedHandle< XmlElement > | hElement | ) | `[pure virtual]`

Set the parent element of this value.

Once set, the parent cannot be reset.

Parameters:

  | hElement | the parent element

Exceptions:

  | coherence::lang::IllegalArgumentException | if the specified parent is NULL
  | coherence::lang::IllegalStateException | if the parent is already set

virtual bool isEmpty | ( |  | ) | const `[pure virtual]`

Determine if the value is empty.

Returns:
  true if the value is empty, false otherwise

virtual bool isAttribute | ( |  | ) | const `[pure virtual]`

Determine if this value is an element attribute.

Returns:
  true if this value is an element attribute, false otherwise

virtual bool isContent | ( |  | ) | const `[pure virtual]`

Determine if this value is an element's content.

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

virtual void writeValue | ( | std::ostream & | out | ) | const `[pure virtual]`

Write the value as XML.

Parameters:

  | out | an std::ostream to write to

The documentation for this class was generated from the following file:

- coherence/run/xml/XmlValue.hpp

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.