# text
[AXIOM]

## Typedefs
typedef struct axiom_text | axiom_text_t
## Functions
AXIS2_EXTERN axiom_text_t * | axiom_text_create (const axutil_env_t *env, axiom_node_t *parent, const axis2_char_t *value, axiom_node_t **node)
AXIS2_EXTERN axiom_text_t * | axiom_text_create_str (const axutil_env_t *env, axiom_node_t *parent, axutil_string_t *value, axiom_node_t **node)
AXIS2_EXTERN axiom_text_t * | axiom_text_create_with_data_handler (const axutil_env_t *env, axiom_node_t *parent, axiom_data_handler_t *data_handler, axiom_node_t **node)
AXIS2_EXTERN void | axiom_text_free (struct axiom_text *om_text, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axiom_text_serialize (struct axiom_text *om_text, const axutil_env_t *env, axiom_output_t *om_output)
AXIS2_EXTERN axis2_status_t | axiom_text_set_value (struct axiom_text *om_text, const axutil_env_t *env, const axis2_char_t *value)
AXIS2_EXTERN const axis2_char_t * | axiom_text_get_value (struct axiom_text *om_text, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axiom_text_set_value_str (struct axiom_text *om_text, const axutil_env_t *env, axutil_string_t *value)
AXIS2_EXTERN const axis2_char_t * | axiom_text_get_text (axiom_text_t *om_text, const axutil_env_t *env)
AXIS2_EXTERN axutil_string_t * | axiom_text_get_value_str (struct axiom_text *om_text, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axiom_text_set_optimize (struct axiom_text *om_text, const axutil_env_t *env, axis2_bool_t optimize)
AXIS2_EXTERN axis2_status_t | axiom_text_set_is_binary (struct axiom_text *om_text, const axutil_env_t *env, const axis2_bool_t is_binary)
AXIS2_EXTERN axiom_data_handler_t * | axiom_text_get_data_handler (struct axiom_text *om_text, const axutil_env_t *env)
AXIS2_EXTERN axis2_char_t * | axiom_text_get_content_id (struct axiom_text *om_text, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axiom_text_set_content_id (axiom_text_t *om_text, const axutil_env_t *env, const axis2_char_t *content_id)
AXIS2_EXTERN axis2_status_t | axiom_text_set_is_swa (struct axiom_text *om_text, const axutil_env_t *env, const axis2_bool_t is_swa)

## Function Documentation

AXIS2_EXTERN axiom_text_t* axiom_text_create | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | const axis2_char_t * | value,
|  | axiom_node_t ** | node |
| ) |  |  |

Creates a new text struct

Parameters:

  | env | Environment.
  | parent | parent of the new node. Optinal, can be NULL. The parent element must be of type AXIOM_ELEMENT
  | value | Text value. Optinal, can be NULL.
  | comment_node | This is an out parameter. cannot be NULL. Returns the node corresponding to the text struct created. Node type will be set to AXIOM_TEXT

Returns:
  pointer to newly created text struct

AXIS2_EXTERN axiom_text_t* axiom_text_create_str | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | axutil_string_t * | value,
|  | axiom_node_t ** | node |
| ) |  |  |

Creates a new text struct

Parameters:

  | env | Environment.
  | parent | parent of the new node. Optinal, can be NULL. The parent element must be of type AXIOM_ELEMENT
  | value | Text value string. Optinal, can be NULL.
  | comment_node | This is an out parameter. cannot be NULL. Returns the node corresponding to the text struct created. Node type will be set to AXIOM_TEXT

Returns:
  pointer to newly created text struct

AXIS2_EXTERN axiom_text_t* axiom_text_create_with_data_handler | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | axiom_data_handler_t * | data_handler,
|  | axiom_node_t ** | node |
| ) |  |  |

Creates a new text struct for binary data (MTOM)

Parameters:

  | env | Environment.
  | parent | parent of the new node. Optinal, can be NULL. The parent element must be of type AXIOM_ELEMENT
  | data_handler | data handler. Optinal, can be NULL.
  | comment_node | This is an out parameter. cannot be NULL. Returns the node corresponding to the text struct created. Node type will be set to AXIOM_TEXT

Returns:
  pointer to newly created text struct

AXIS2_EXTERN void axiom_text_free | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env |
| ) |  |  |

Free an axiom_text struct

Parameters:

  | env | environment.
  | om_text | pointer to om text struct to be freed.

Returns:
  satus of the op. AXIS2_SUCCESS on success AXIS2_FAILURE on error.

AXIS2_EXTERN axis2_char_t* axiom_text_get_content_id | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the Content ID of the OM text

Parameters:

  | om_text | pointer to the OM Text struct
  | environment | Environment. MUST NOT be NULL

Returns:
  the content id of the OM text

AXIS2_EXTERN axiom_data_handler_t* axiom_text_get_data_handler | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the data handler of the OM text

Parameters:

  | om_text | pointer to the OM Text struct
  | environment | Environment. MUST NOT be NULL

Returns:
  the data handler of the OM text

AXIS2_EXTERN const axis2_char_t* axiom_text_get_text | ( | axiom_text_t * | om_text,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets text value from the text node even when MTOM optimized

Parameters:

  | om_text | om_text struct
  | env | environment.

Returns:
  text value base64 encoded text when MTOM optimized, NULL is returned if there is no text value.

AXIS2_EXTERN const axis2_char_t* axiom_text_get_value | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets text value

Parameters:

  | om_text | om_text struct
  | env | environment.

Returns:
  text value , NULL is returned if there is no text value.

AXIS2_EXTERN axutil_string_t* axiom_text_get_value_str | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets text value

Parameters:

  | om_text | om_text struct
  | env | environment.

Returns:
  text valu stringe , NULL is returned if there is no text value.

AXIS2_EXTERN axis2_status_t axiom_text_serialize | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env,
|  | axiom_output_t * | om_output |
| ) |  |  |

Serialize op

Parameters:

  | env | environment.
  | om_text | pointer to om text struct to be serialized.
  | om_output | AXIOM output handler to be used in serializing.

Returns:
  satus of the op. AXIS2_SUCCESS on success, AXIS2_FAILURE on error

AXIS2_EXTERN axis2_status_t axiom_text_set_content_id | ( | axiom_text_t * | om_text,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | content_id |
| ) |  |  |

Set the content ID of the OM text

Parameters:

  | om_text | pointer to the OM Text struct
  | environment | Environment. MUST NOT be NULL
  | content_id | the content ID

Returns:
  status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axiom_text_set_is_binary | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env,
|  | const axis2_bool_t | is_binary |
| ) |  |  |

Parameters:

  | om_text | text value
  | env | environment
  | is_binary |

Returns:
  AXIS2_SUCCESS

AXIS2_EXTERN axis2_status_t axiom_text_set_is_swa | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env,
|  | const axis2_bool_t | is_swa |
| ) |  |  |

Sets the boolean value indicating if the binary data associated with the text node should be sent in SOAP with Attachment (SwA) format or not.

Parameters:

  | om_text | text node
  | env | environment
  | is_swa | bool value, AXIS2_TRUE means use SwA format, else AXIS2_FALSE

Returns:
  AXIS2_SUCCESS

AXIS2_EXTERN axis2_status_t axiom_text_set_optimize | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env,
|  | axis2_bool_t | optimize |
| ) |  |  |

Sets optimized

Parameters:

  | om_text | pointer to om_text struct
  | env | environment optimize value

Returns:
  AXIS2_SUCCESS

AXIS2_EXTERN axis2_status_t axiom_text_set_value | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | value |
| ) |  |  |

Sets the text value

Parameters:

  | om_text | om_text struct
  | env | environment.
  | value | text

Returns:
  status of the op. AXIS2_SUCCESS on success, AXIS2_FAILURE on error.

AXIS2_EXTERN axis2_status_t axiom_text_set_value_str | ( | struct axiom_text * | om_text,
|  | const axutil_env_t * | env,
|  | axutil_string_t * | value |
| ) |  |  |

Sets the text value

Parameters:

  | om_text | om_text struct
  | env | environment.
  | value | string

Returns:
  status of the op. AXIS2_SUCCESS on success, AXIS2_FAILURE on error.