The SWIFT OTD Library provides a set of run-time methods that allow you to manipulate OTD data in a variety of ways. The following methods are the most frequently used with validation operations:
set(): Allows you to set data on a parent node using a byte array or a string as a parameter.
value(): Lets you get the string value of data in a node at any tree level.
getLastSuccessInfo(): Returns a string that represents information about the last node in the tree that was successfully parsed.
command(): Allows you to pass flags as parameters, which set levels that determine the quantity of debug information you receive (see Setting the Debug Level for details).
marshalToString() and unmarshalFromString(): Returns string data from or accepts string data to a desired node.
In addition, the library has methods that allow you to perform basic but necessary operations with the OTDs. See Table 11.
Table 11 Basic OTD Methods
Method |
Description |
---|---|
add() |
Adds a repetition to a given child node. |
append() |
Adds given data at the end of existing data. |
copy() |
Copies given data at a specified point. |
count() |
Gives the count of node repetitions. |
delete() |
Erases data at a specified point. |
get() |
Retrieves data from a node. |
has() |
Checks whether a specified child node is present. |
insert() |
Inserts given data at a specified point. |
length() |
Returns the length of data contained in an object. |
marshal() |
Serializes internal data into an output stream. |
remove() |
Removes a given child node repetition. |
reset() |
Clears out any data held by an OTD. |
size() |
Returns the current number of repetitions for the current child node. |
unmarshal() |
Parses given input data into an internal data tree. |
To help in your use of the SWIFT OTD Library and its features, the library includes a Javadoc. You can see this document for complete details on all of these methods. See Table 13 for more information on this document and how to use it.