|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines all the xml data access methods. Wherever addresses are involved in creating new resources, all non-existing collections in the specified path to the resource will be created automatically.
All the methods throw the following exceptions:
| Method Summary | |
boolean |
deleteXML(String address,
String xpath)
Deletes the node pointed to by the xpath, from the xml resource. |
String |
getXML(String address)
Retrieves the XML data from the specified address. |
org.dom4j.Document |
getXMLDocument(String address)
Retrieves the XML data from the specified address. |
void |
insertXML(String address,
String xpath,
org.dom4j.Node newContent)
Inserts the given xml node into the xml resource immediately after the node specified by the xpath. |
Object |
queryXML(String xmlResourceAddress,
String query,
short returnType)
Executes the given query on the XML resource and returns the results in the format specified by the returnType parameter. |
void |
replaceXML(String address,
String xpath,
org.dom4j.Node newContent)
Replaces the specified node in the resource with the new node. |
void |
replaceXMLContent(String xmlResourceAddress,
int beginIndex,
int endIndex,
String newContent)
Treats an xml resource as text resource (all tags are ignored as if they didnt exist) and replaces the text from beginIndex to endIndex-1 with the new text content. |
boolean |
storeXML(String address,
org.dom4j.Document content,
boolean force)
Creates a new XML resource with the given content, reindented for readability. |
boolean |
storeXML(String address,
org.dom4j.Document content,
boolean force,
boolean indent)
Creates a new XML resource with the given content, possibly reindented. |
| Method Detail |
public org.dom4j.Document getXMLDocument(String address)
throws MalformedAddressException,
ResourceNotFoundException,
IOException
address - address of the xml resource
ResourceNotFoundException - if the resource doesnt exist
MalformedAddressException
IOException
public String getXML(String address)
throws MalformedAddressException,
ResourceNotFoundException,
IOException
address - address of the xml resource
ResourceNotFoundException - if the resource doesnt exist
MalformedAddressException
IOException
public boolean storeXML(String address,
org.dom4j.Document content,
boolean force)
throws MalformedAddressException,
IOException
storeXML(String, Document, boolean, boolean)
instead to preserve whitespace. This method is to be used for XML
resources that do not have concurrent hierarchies.
address - the address of the resource.content - the Document to be writtenforce - if true then the resource is overwritten if it already exists
MalformedAddressException
IOException
public boolean storeXML(String address,
org.dom4j.Document content,
boolean force,
boolean indent)
throws MalformedAddressException,
IOException
address - the address of the resourcecontent - the Document to be writtenforce - if true then the resource is overwritten if it already existsindent - if true reindent the document, compressing contiguous
sequences of whitespace characters in content.
MalformedAddressException
IOException
public void insertXML(String address,
String xpath,
org.dom4j.Node newContent)
throws MalformedAddressException,
ResourceNotFoundException,
InvalidNodePathException,
IOException
address - address of the resourcexpath - valid path to a nodenewContent - new node
ResourceNotFoundException - if the resource doesnt exist
InvalidNodePathException - if the given xpath does not point to a node (valid location)
MalformedAddressException
IOException
public void replaceXML(String address,
String xpath,
org.dom4j.Node newContent)
throws MalformedAddressException,
ResourceNotFoundException,
InvalidNodePathException,
IOException
address - address of the resourcexpath - valid path to an existing node in the resourcenewContent - new node
ResourceNotFoundException - if the resource doesnt exist
InvalidNodePathException - if the given xpath does not point to a node (valid location) in the resource
MalformedAddressException
IOException
public void replaceXMLContent(String xmlResourceAddress,
int beginIndex,
int endIndex,
String newContent)
throws MalformedAddressException,
ResourceNotFoundException,
IndexOutOfBoundsException,
IOException
xmlResourceAddress - address of the resourcebeginIndex - beginIndex, inclusiveendIndex - endIndex, exclusivenewContent - new text content
ResourceNotFoundException - if the resource doesnt exist
IndexOutOfBoundsException - if the beginIndex is negative, or beginIndex is larger than endIndex and endIndex is not EOF.
MalformedAddressException
IOException
public boolean deleteXML(String address,
String xpath)
throws MalformedAddressException,
ResourceNotFoundException,
InvalidNodePathException,
IOException
address - address of the resourcexpath - valid path to an existing node in the resource
ResourceNotFoundException - if the resource doesnt exist
InvalidNodePathException - if the given xpath does not point to a node (valid location) in the resource
MalformedAddressException
IOException
public Object queryXML(String xmlResourceAddress,
String query,
short returnType)
throws MalformedAddressException,
ResourceNotFoundException,
MalformedQueryException,
IOException,
InvalidTypeException
xmlResourceAddress - address of the XML resourcequery - the queryreturnType - return type.
The following values are valid for the return type:
ResourceNotFoundException - if the resource doesnt exist
MalformedQueryException - if the query is malformed
InvalidTypeException - if the return type specified is unrecognized
MalformedAddressException
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||