|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.xml.XMLPathCtx
public class XMLPathCtx
Encapsulates context informations for xpath expressions.
Use this class to create new XMLPath objectes and combinations of them. This class wraps the javax.xml.xpath package with performance improvments and simpler useage.
Field Summary | |
---|---|
static String |
PREFERED_XPATH_FACTORIES
change this property to set your prefered xpath engine. |
Constructor Summary | |
---|---|
protected |
XMLPathCtx(org.n52.security.common.xml.XMLPathCtx.XPathPool xPathPool)
Constructor creates a new instance. |
Method Summary | |
---|---|
XMLPathCtx |
addNamespace(String prefix,
String namespace)
Method adds prefix to namespace mapping, so the prefix can be used to qualify xpath expressions. |
XMLPathCtx |
addNamespaces(Map<String,String> prefixNamespaceMap)
Adds all namespaces from the given Map |
XMLPathCtx |
addNamespaces(SimpleNamespaceContext ctx)
Adds all namespaces from the given context to the internal prefix list. |
static XMLPathCtx |
createNew()
Method creates a new XMLPathCtx instance. |
XMLPath |
findIn(Document doc)
Method findIn constructs a new XMLPath starting in a Document source. |
XMLPath |
findIn(InputSource source)
Method findIn constructs a new XMLPath starting in a InputSource source. |
XMLPath |
findIn(Node node)
Method findIn constructs a new XMLPath starting in a Node source. |
XMLPath |
findIn(NodeList nodeList)
Method findIn constructs a new XMLPath starting in a NodeList source. |
XMLPath |
findIn(String source)
Method findIn constructs a new XMLPath starting in a string source. |
protected XPathExpression |
lookUp(String xpath)
Method looks up an XPathExpression. |
XMLPathCtx |
register(String xpath)
Method registers an xpath as precompiled XPathExpression. |
XMLPathCtx |
register(String name,
String xpath)
Method registers an xpath as precompiled XPathExpression with a special name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String PREFERED_XPATH_FACTORIES
XPathFactory.newInstance()
.
Constructor Detail |
---|
protected XMLPathCtx(org.n52.security.common.xml.XMLPathCtx.XPathPool xPathPool)
xPathPool
- the xPathPool.Method Detail |
---|
public XMLPathCtx addNamespace(String prefix, String namespace)
prefix
- the prefix.namespace
- the namespace.
public XMLPathCtx addNamespaces(SimpleNamespaceContext ctx)
ctx
- an namespace context.
public XMLPathCtx addNamespaces(Map<String,String> prefixNamespaceMap)
prefixNamespaceMap
- a map with prefix to namespace mappings.
public static XMLPathCtx createNew()
public XMLPath findIn(Document doc)
doc
- the doc.
public XMLPath findIn(Node node)
node
- the node.
public XMLPath findIn(NodeList nodeList)
nodeList
- the nodeList.
public XMLPath findIn(InputSource source)
source
- the source.
public XMLPath findIn(String source)
source
- the source.
protected XPathExpression lookUp(String xpath)
xpath
- the xpath.
public XMLPathCtx register(String xpath)
xpath
- the xpath.
public XMLPathCtx register(String name, String xpath)
name
- the name.xpath
- the xpath.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |