|
Oracle® Fusion Middleware Java API Reference for Oracle WebCenter Content Remote Intradoc Client (RIDC) 11g Release 1 (11.1) E17274-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.stellent.ridc.common.xml.XPathEvaluator
public class XPathEvaluator
Parses an XML file from a given inputstream. Wraps calls into the XPath API.
Field Summary | |
---|---|
protected Node |
m_contextNode |
protected String |
m_defaultPrefix |
protected Element |
m_documentRoot |
protected NamespaceContext |
m_namespaceContext |
protected XPath |
m_xpath |
Constructor Summary | |
---|---|
XPathEvaluator(Element rootElement) Initialize an Evaluator object based on the current element as the root |
|
XPathEvaluator(Element rootElement, NamespaceContext namespaceContext) Initialize an Evaluator object based on the current element as the root |
|
XPathEvaluator(InputSource xmlSource, NamespaceContext namespaceContext, boolean validating, String defaultPrefix) Builds a new XPath evaluator from an InputSource. |
|
XPathEvaluator(InputStream xmlStream) Builds an XPathEvaluator with no namespace evaluator and non-validating, using "wcm" as the default namespace prefix. |
|
XPathEvaluator(InputStream xmlStream, NamespaceContext namespaceContext, boolean validating, String defaultPrefix) Builds a new XPath evaluator from InputStream. |
|
XPathEvaluator(Reader xmlReader) |
|
XPathEvaluator(Reader xmlReader, NamespaceContext namespaceContext, boolean validating, String defaultPrefix) Builds a new XPath evaluator from a Reader. |
Method Summary | |
---|---|
protected XPathExpression |
compileXPathExpression(String xpath) |
Node |
evaluateToNode(String xpath) Evaluate the xpath expression; return the result as a Node |
NodeList |
evaluateToNodeList(String xpath) Evaluate the xpath expression; return the result as a NodeList |
String |
evaluateToString(String xpath) Evaluate the xpath expression; return the result as a String. |
protected Object |
evaluateXPath(String xpath, QName returnType) |
Node |
getContextNode() |
Node |
getElementById(String id) Retrieve an element by ID. |
NamespaceContext |
getNamespaceContext() |
Element |
getRootNode() |
protected XPath |
getXPath() |
protected void |
initNamespaceContext(NamespaceContext namespaceContext) Initialize the namespace context. |
void |
resetContext() Reset the context to the root node |
void |
setContextNode(Node node) Set the context of the queries |
void |
setContextNode(String xpath) Set the context of the queries to be the result of the given xpath expression |
void |
setIdAttribute(String attribute, boolean enable) Set the ID attribute feature against this DOM tree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NamespaceContext m_namespaceContext
protected Element m_documentRoot
protected XPath m_xpath
protected Node m_contextNode
protected String m_defaultPrefix
Constructor Detail |
---|
public XPathEvaluator(Element rootElement)
rootElement
- the root of all xpath queriespublic XPathEvaluator(Element rootElement, NamespaceContext namespaceContext)
rootElement
- the root of all xpath queriesnamespaceContext
- the namespace context to usepublic XPathEvaluator(InputStream xmlStream) throws XPathEvaluatorException
xmlStream
- the stream to the xml file contentsXPathEvaluatorException
public XPathEvaluator(InputStream xmlStream, NamespaceContext namespaceContext, boolean validating, String defaultPrefix) throws XPathEvaluatorException
xmlStream
- the stream to the xml file contentsnamespaceContext
- (optional) the namespace resolvervalidating
- true to set the parser to validatingdefaultPrefix
- the prefix to use for querying in the default namespaceXPathEvaluatorException
public XPathEvaluator(Reader xmlReader) throws XPathEvaluatorException
XPathEvaluatorException
public XPathEvaluator(Reader xmlReader, NamespaceContext namespaceContext, boolean validating, String defaultPrefix) throws XPathEvaluatorException
xmlReader
- the reader to the xml file contentsnamespaceContext
- (optional) the namespace resolvervalidating
- true to set the parser to validatingdefaultPrefix
- the prefix to use for querying in the default namespaceXPathEvaluatorException
public XPathEvaluator(InputSource xmlSource, NamespaceContext namespaceContext, boolean validating, String defaultPrefix) throws XPathEvaluatorException
xmlSource
- the inputSource to the xml file contentsnamespaceContext
- (optional) the namespace resolvervalidating
- true to set the parser to validatingdefaultPrefix
- the prefix to use for querying in the default namespaceXPathEvaluatorException
Method Detail |
---|
protected void initNamespaceContext(NamespaceContext namespaceContext)
namespaceContext
- the namespace context or null to use the defaultpublic NamespaceContext getNamespaceContext()
public void setIdAttribute(String attribute, boolean enable)
attribute
- the attribute to declare as the DOM ID attributeenable
- true to enable this attribute, false to disable the ID functionalitypublic Node getElementById(String id)
setIdAttribute(String, boolean)
to enable the ID attribute functionality.id
- the ID to querypublic void setContextNode(Node node)
node
- the context nodepublic void setContextNode(String xpath)
xpath
- the xpath to the root for the queriespublic Node getContextNode()
public Element getRootNode()
public void resetContext()
public String evaluateToString(String xpath)
xpath
- the xpath expression from the current context rootpublic Node evaluateToNode(String xpath)
xpath
- the xpath expression from the current context rootpublic NodeList evaluateToNodeList(String xpath)
xpath
- the xpath expression from the current context rootprotected Object evaluateXPath(String xpath, QName returnType)
protected XPathExpression compileXPathExpression(String xpath) throws XPathEvaluatorException
XPathEvaluatorException
protected XPath getXPath()
|
Oracle® Fusion Middleware Java API Reference for Oracle WebCenter Content Remote Intradoc Client (RIDC) 11g Release 1 (11.1) E17274-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |