org.apache.any23.validator
Interface DOMDocument

All Known Implementing Classes:
DefaultDOMDocument

public interface DOMDocument

This interface models a document to be processed by the Validator.

Author:
Michele Mostarda (mostarda@fbk.eu), Davide Palmisano (palmisano@fbk.eu)

Method Summary
 void addAttribute(String xPath, String attrName, String attrValue)
          Adds an attribute to a node addressed by the given XPath.
 URI getDocumentURI()
           
 Node getNode(String xPath)
          Returns the node addressed by the given XPath, if more then one an exception will be raised.
 List<Node> getNodes(String xPath)
          Returns the list of nodes addressed by the given XPath.
 List<Node> getNodesWithAttribute(String attrName)
          Returns all the nodes declaring an attribute with the specified name.
 Document getOriginalDocument()
          Returns the original document.
 

Method Detail

getDocumentURI

URI getDocumentURI()
Returns:
the original document URI.

getOriginalDocument

Document getOriginalDocument()
Returns the original document.

Returns:
the original document.

getNodes

List<Node> getNodes(String xPath)
Returns the list of nodes addressed by the given XPath.

Parameters:
xPath - a valid XPath
Returns:
a not null list of nodes.

getNode

Node getNode(String xPath)
Returns the node addressed by the given XPath, if more then one an exception will be raised.

Parameters:
xPath - a valid XPath.
Returns:
a node or null if nothing found.

addAttribute

void addAttribute(String xPath,
                  String attrName,
                  String attrValue)
Adds an attribute to a node addressed by the given XPath.

Parameters:
xPath - the XPath pointing the node.
attrName - the name of the attribute.
attrValue - the value of the attribute.

getNodesWithAttribute

List<Node> getNodesWithAttribute(String attrName)
Returns all the nodes declaring an attribute with the specified name.

Parameters:
attrName - name of attribute to use for filtering.
Returns:
a list of nodes. null if no matches found.


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.