|
CDMA client API
3.1.0
CDMA core library
|
The IWriter interface provides methods of outputting CDMA object. More...
Public Member Functions | |
| void | open () throws WriterException |
| boolean | isOpen () |
| void | writeToRoot (IGroup group) throws WriterException |
| void | writeToRoot (IGroup group, boolean force) throws WriterException |
| void | writeToRoot (IDataItem dataItem) throws WriterException |
| void | writeToRoot (IDataItem dataItem, boolean force) throws WriterException |
| void | writeToRoot (IAttribute attribute) throws WriterException |
| void | writeToRoot (IAttribute attribute, boolean force) throws WriterException |
| void | writeGroup (String parentPath, IGroup group) throws WriterException |
| void | writeGroup (String parentPath, IGroup group, boolean force) throws WriterException |
| void | writeDataItem (String parentPath, IDataItem dataItem) throws WriterException |
| void | writeDataItem (String parentPath, IDataItem dataItem, boolean force) throws WriterException |
| void | writeAttribute (String parentPath, IAttribute attribute) throws WriterException |
| void | writeAttribute (String parentPath, IAttribute attribute, boolean force) throws WriterException |
| void | writeEmptyGroup (String xPath, String groupName, boolean force) throws WriterException |
| void | removeGroup (String groupPath) |
| void | removeDataItem (String dataItemPath) throws WriterException |
| void | removeAttribute (String attributePath) throws WriterException |
| boolean | isGroupExist (String xPath) |
| boolean | isGroupExist (String parentPath, String groupName) |
| boolean | isDataItemExist (String xPath) |
| boolean | isDataItemExist (String parentPath, String dataItemName) |
| boolean | isAttributeExist (String xPath) |
| boolean | isAttributeExist (String parentPath, String attributeName) |
| void | close () |
The IWriter interface provides methods of outputting CDMA object.
The interface of CDMA writer provides methods of outputting to a storage that has a tree structure.
| void org.gumtree.data.io.IWriter.close | ( | ) |
Close the file handler. Unlock the file.
| boolean org.gumtree.data.io.IWriter.isAttributeExist | ( | String | xPath | ) |
Check if an attribute exist with a given xpath.
| xPath | x-path as a String object |
| boolean org.gumtree.data.io.IWriter.isAttributeExist | ( | String | parentPath, |
| String | attributeName | ||
| ) |
Check if the attribute with a given name already exists.
| parentPath | String object |
| attributeName | String object |
| boolean org.gumtree.data.io.IWriter.isDataItemExist | ( | String | xPath | ) |
Check if a data item exists with a given X-path.
| xPath | as a String object |
| boolean org.gumtree.data.io.IWriter.isDataItemExist | ( | String | parentPath, |
| String | dataItemName | ||
| ) |
Check if a data item exists under a parent group with a given X-path.
| parentPath | x-path of the parent group as a String object |
| dataItemName | name of the target data item |
| boolean org.gumtree.data.io.IWriter.isGroupExist | ( | String | xPath | ) |
Check if a group exists in a given X-path.
| xPath | as a String object |
| boolean org.gumtree.data.io.IWriter.isGroupExist | ( | String | parentPath, |
| String | groupName | ||
| ) |
Check if a group exists under certain group node with a given X-path.
| parentPath | the X-path of the parent group |
| groupName | the name of the target group |
| boolean org.gumtree.data.io.IWriter.isOpen | ( | ) |
Check if the storage is open for output.
| void org.gumtree.data.io.IWriter.open | ( | ) | throws WriterException |
Open the storage, for example, the file handler. Any output action will require the storage to be open.
| WriterException | failed to open the storage |
| void org.gumtree.data.io.IWriter.removeAttribute | ( | String | attributePath | ) | throws WriterException |
Remove an attribute with a given X-path from the storage.
| attributePath | x-path as a String object |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.removeDataItem | ( | String | dataItemPath | ) | throws WriterException |
Remove a data item with a given X-path from the storage.
| dataItemPath | as a String object |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.removeGroup | ( | String | groupPath | ) |
Remove a group with a given X-path from the storage.
| groupPath | as a String object |
| void org.gumtree.data.io.IWriter.writeAttribute | ( | String | parentPath, |
| IAttribute | attribute | ||
| ) | throws WriterException |
Write an attribute under a node with a given X-path. The parent node can be either a group node or a data item node. If an attribute node with the same name already exists, raise an exception.
| parentPath | x-path as a String object |
| attribute | CDMA attribute |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeAttribute | ( | String | parentPath, |
| IAttribute | attribute, | ||
| boolean | force | ||
| ) | throws WriterException |
Write an attribute to the node with a given X-path. The node can be either a group node or a data item node. If an attribute with an existing name already exists, raise an exception.
| parentPath | x-path as a String object |
| attribute | CDMA attribute |
| force | if allowing overwriting |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeDataItem | ( | String | parentPath, |
| IDataItem | dataItem | ||
| ) | throws WriterException |
Write a data item under a group node with a given X-path. If a data item node already exists there, raise an exception.
| parentPath | x-path as a String object |
| dataItem | CDMA data item |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeDataItem | ( | String | parentPath, |
| IDataItem | dataItem, | ||
| boolean | force | ||
| ) | throws WriterException |
Write a data item under a group node with a given X-path. If a data item node already exists there, check the 'force' switch. If it is true, overwrite the node. Otherwise raise an exception.
| parentPath | String value |
| dataItem | IDataItem object |
| force | true or false |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeEmptyGroup | ( | String | xPath, |
| String | groupName, | ||
| boolean | force | ||
| ) | throws WriterException |
Write an empty group under a group node with a given X-path. If a group node with the same name already exists, check the 'force' switch. If it is true, remove all the contents of the group node.
| xPath | as a String object |
| groupName | short name as a String object |
| force | if allow overwriting |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeGroup | ( | String | parentPath, |
| IGroup | group | ||
| ) | throws WriterException |
Write a group under the node with a given X-path. If a group node with the same name already exists, this will not overwrite any existing contents under the node. When conflicting happens, raise an exception.
| parentPath | x-path as a String object |
| group | CDMA group |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeGroup | ( | String | parentPath, |
| IGroup | group, | ||
| boolean | force | ||
| ) | throws WriterException |
Write a group under the node of a given X-path. If a group node with the same name already exists, check the 'force' switch. If it is true, overwrite any conflicting contents under the node. Otherwise raise an exception for conflicting.
| parentPath | x-path as a String object |
| group | CDMA group |
| force | if allow overwriting |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeToRoot | ( | IGroup | group | ) | throws WriterException |
Add a group to the root of the storage. This has the same performance as writeToRoot(IGroup group, boolean force), where force is set to be false.
| group | CDMA group object |
| WriterException | failed to write the group |
| void org.gumtree.data.io.IWriter.writeToRoot | ( | IGroup | group, |
| boolean | force | ||
| ) | throws WriterException |
Write a group to the root of the storage. When a group with a same name already exists under the root node, write the contents of the CDMA group under the target group node. For conflict data item, check the force switch. If it is set to be true, overwrite the contents under the group. Otherwise raise an exception.
| group | CDMA group object |
| force | if allow overwriting |
| WriterException | failed to write to data source |
| void org.gumtree.data.io.IWriter.writeToRoot | ( | IDataItem | dataItem | ) | throws WriterException |
Write a data item to the root of the storage. If a data node with the same name already exists, raise an exception.
| dataItem | CDMA data item |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeToRoot | ( | IDataItem | dataItem, |
| boolean | force | ||
| ) | throws WriterException |
Write a data item to the root of the storage. If force is true, overwrite the conflicting node.
| dataItem | CDMA data item |
| force | if allow overwriting |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeToRoot | ( | IAttribute | attribute | ) | throws WriterException |
Write an attribute to the root of the storage. If an attribute node already exists in the root of the storage, raise an exception.
| attribute | CDMA attribute |
| WriterException | failed to write |
| void org.gumtree.data.io.IWriter.writeToRoot | ( | IAttribute | attribute, |
| boolean | force | ||
| ) | throws WriterException |
Write an attribute to the root of the storage. If an attribute node already exists, check the force switch. If it is true, overwrite the node. Otherwise raise an exception.
| attribute | CDMA attribute |
| force | if allow overwriting |
| WriterException | failed to write |