# wso2wsf::OMNode Class Reference
[OM Node]

class OMNode Defines the base interface used by most of the XML object model within Axis. This tree model for XML captures the idea of deferring the construction of child nodes until they are needed. The isComplete function identifies whether or not a particular node has been fully parsed. A node may not be fully parsed, for example, if all of the children of an element have not yet been parsed. More...

`#include <OMNode.h>`

Inheritance diagram for wso2wsf::OMNode:

List of all members.

## Public Member Functions
| OMNode ()
virtual | ~OMNode ()
WSF_EXTERN void | setAxiomNode (axiom_node_t *node)
WSF_EXTERN axiom_node_t * | getAxiomNode ()
virtual WSF_EXTERN std::string | toString ()
virtual std::string | subTreeToString ()
virtual void | freeTree ()
virtual bool | insertSiblingAfter (OMNode *to_insert)
virtual bool | insertSiblingBefore (OMNode *to_insert)
virtual OMNode * | detach ()
virtual OMNode * | getParent ()
virtual void | setParent (OMNode *parent)
virtual OMNode * | getPreviousSibling ()
virtual OMNode * | getNextSibling ()
virtual axiom_types_t | nodeType ()=0
## Protected Attributes
OMNode * | _parent
## Friends
WSF_EXTERN std::ostream & | operator<< (std::ostream &str, OMNode const &node)
WSF_EXTERN std::ostream & | operator<< (std::ostream &str, OMNode const *node)

## Detailed Description

class OMNode Defines the base interface used by most of the XML object model within Axis. This tree model for XML captures the idea of deferring the construction of child nodes until they are needed. The isComplete function identifies whether or not a particular node has been fully parsed. A node may not be fully parsed, for example, if all of the children of an element have not yet been parsed.

## Constructor & Destructor Documentation

wso2wsf::OMNode::OMNode | ( |  | ) |

Creates a node object.

virtual wso2wsf::OMNode::~OMNode | ( |  | ) | `[virtual]`

destructor that can be overridden.

## Member Function Documentation

virtual OMNode* wso2wsf::OMNode::detach | ( |  | ) | `[virtual]`

Detaches given node from the parent and reset the links.

Returns:
  a pointer to detached node,returns NULL on error with error code set to environment's error struct.

virtual void wso2wsf::OMNode::freeTree | ( |  | ) | `[virtual]`

Frees an om node and all of its children.

Reimplemented in wso2wsf::OMElement.

WSF_EXTERN axiom_node_t* wso2wsf::OMNode::getAxiomNode | ( |  | ) |

Method to get the reference to the axiom_node struct.

Returns:
  reference to the axiom_node struct.

virtual OMNode* wso2wsf::OMNode::getNextSibling | ( |  | ) | `[virtual]`

get next sibling.

Returns:
  next sibling of this node.

virtual OMNode* wso2wsf::OMNode::getParent | ( |  | ) | `[virtual]`

get parent of node.

Returns:
  pointer to parent node of node, return NULL if no parent exists or when an error occurred.

virtual OMNode* wso2wsf::OMNode::getPreviousSibling | ( |  | ) | `[virtual]`

get the previous sibling.

Returns:
  a pointer to previous sibling , NULL if a previous sibling does not exits (happens when this node is the first child of a node).

virtual bool wso2wsf::OMNode::insertSiblingAfter | ( | OMNode * | to_insert | ) | `[virtual]`

Inserts a sibling node after this node.

Parameters:

  | to_insert | the node to be inserted. Cannot be NULL.

Returns:
  status of the op, true on success else false.

Reimplemented in wso2wsf::OMElement.

virtual bool wso2wsf::OMNode::insertSiblingBefore | ( | OMNode * | to_insert | ) | `[virtual]`

Inserts a sibling node before this current node.

Parameters:

  | to_insert | the node to be inserted. Cannot be NULL.

Returns:
  status of the op, true on success else false.

Reimplemented in wso2wsf::OMElement.

virtual axiom_types_t wso2wsf::OMNode::nodeType | ( |  | ) | `[pure virtual]`

get the node type of this element. Node type can be one of AXIOM_ELEMENT, AXIOM_COMMENT, AXIOM_TEXT AXIOM_DOCTYPE, AXIOM_PROCESSING_INSTRUCTION.

Returns:
  node type.

Implemented in wso2wsf::OMElement, and wso2wsf::OMText.

WSF_EXTERN void wso2wsf::OMNode::setAxiomNode | ( | axiom_node_t * | node | ) |

Method to set the reference to the axiom_node struct.

Parameters:

  | node | axiom_node reference.

virtual void wso2wsf::OMNode::setParent | ( | OMNode * | parent | ) | `[virtual]`

Set Parent of this Node.If the child node already has a parent which is different to the parent being set, the child will be detached first.

Parameters:

  | parent | Parent element to be set

Returns:
  bool true if success, false otherwise

virtual std::string wso2wsf::OMNode::subTreeToString | ( |  | ) | `[virtual]`

Converts sub tree starting from given node to string.

Returns:
  converted node as string.

virtual WSF_EXTERN std::string wso2wsf::OMNode::toString | ( |  | ) | `[virtual]`

Converts this node to a string.

Returns:
  converted node as string.

## Friends And Related Function Documentation

WSF_EXTERN std::ostream& operator<< | ( | std::ostream & | str,
|  | OMNode const * | node |
| ) |  |  | `[friend]`

Overloaded insertion operator, is used for printing the node onto a console.

Parameters:

  | str | existing stream.
  | node | OMNode object.

Returns:
  a modified output stream is returned.

WSF_EXTERN std::ostream& operator<< | ( | std::ostream & | str,
|  | OMNode const & | node |
| ) |  |  | `[friend]`

Overloaded insertion operator, is used for printing the node onto a console.

Parameters:

  | str | existing stream.
  | node | OMNode object.

Returns:
  a modified output stream is returned.

## Member Data Documentation

OMNode* wso2wsf::OMNode::_parent`[protected]`

_parent variable holds reference for the parent of this node.

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

- OMNode.h