#include <coherence/run/xml/XmlValue.hpp>
Inherits Object.
Inherited by XmlElement [virtual].
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. | |
| 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.
| fDefault | the default return value |
| virtual void setBoolean | ( | bool | fValue | ) | [pure virtual] |
Set the value as a bool.
| 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.
| nDefault | the default return value |
| virtual void setInt32 | ( | int32_t | nValue | ) | [pure virtual] |
Set the integer value.
| 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.
| vsDefault | the default return value |
| virtual void setString | ( | String::View | vsValue | ) | [pure virtual] |
Set the String value.
| 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:
It is always legal for an implementation to return the value as a String.
| virtual TypedHandle<XmlElement> getParent | ( | ) | [pure virtual] |
Get the parent element of this value.
| virtual TypedHandle<const XmlElement> getParent | ( | ) | const [pure virtual] |
Get the parent element of this value as a view.
| virtual void setParent | ( | TypedHandle< XmlElement > | hElement | ) | [pure virtual] |
Set the parent element of this value.
Once set, the parent cannot be reset.
| hElement | the parent element |
| 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.
| virtual bool isAttribute | ( | ) | const [pure virtual] |
Determine if this value is an element attribute.
| virtual bool isContent | ( | ) | const [pure virtual] |
Determine if this value is an element's content.
| virtual void writeValue | ( | std::ostream & | out | ) | const [pure virtual] |
Write the value as XML.
| out | an std::ostream to write to |