@NotThreadSafe public final class XPathHelper extends Object
XPath and XPathExpression objects
more easily.| Modifier and Type | Method and Description |
|---|---|
static XPath |
createNewXPath()
Create a new
XPath without any special settings using the default
XPathFactory. |
static XPath |
createNewXPath(NamespaceContext aNamespaceContext)
Create a new
XPath with the passed namespace context using the
default XPathFactory. |
static XPath |
createNewXPath(XPathFactory aXPathFactory)
Create a new
XPath without any special settings. |
static XPath |
createNewXPath(XPathFactory aXPathFactory,
NamespaceContext aNamespaceContext)
Create a new
XPath with the passed namespace context. |
static XPath |
createNewXPath(XPathFactory aXPathFactory,
XPathFunctionResolver aFunctionResolver)
Create a new
XPath with the passed function resolver. |
static XPath |
createNewXPath(XPathFactory aXPathFactory,
XPathVariableResolver aVariableResolver)
Create a new
XPath with the passed variable resolver. |
static XPath |
createNewXPath(XPathFactory aXPathFactory,
XPathVariableResolver aVariableResolver,
XPathFunctionResolver aFunctionResolver,
NamespaceContext aNamespaceContext)
Create a new
XPath with the passed variable resolver, function
resolver and namespace context. |
static XPath |
createNewXPath(XPathFunctionResolver aFunctionResolver)
Create a new
XPath with the passed function resolver using the
default XPathFactory. |
static XPath |
createNewXPath(XPathVariableResolver aVariableResolver)
Create a new
XPath with the passed variable resolver using the
default XPathFactory. |
static XPath |
createNewXPath(XPathVariableResolver aVariableResolver,
NamespaceContext aNamespaceContext)
Create a new
XPath with the passed variable resolver and namespace
context using the default XPathFactory. |
static XPath |
createNewXPath(XPathVariableResolver aVariableResolver,
XPathFunctionResolver aFunctionResolver,
NamespaceContext aNamespaceContext)
Create a new
XPath with the passed variable resolver, function
resolver and namespace context using the default XPathFactory. |
static XPathExpression |
createNewXPathExpresion(NamespaceContext aNamespaceContext,
String sXPath)
Create a new XPath expression for evaluation using the default
XPathFactory. |
static XPathExpression |
createNewXPathExpresion(String sXPath)
Create a new XPath expression for evaluatio using the default
XPathFactoryn. |
static XPathExpression |
createNewXPathExpresion(XPathFunctionResolver aFunctionResolver,
String sXPath)
Create a new XPath expression for evaluation using the default
XPathFactory. |
static XPathExpression |
createNewXPathExpresion(XPath aXPath,
String sXPath)
Create a new XPath expression for evaluation.
|
static XPathExpression |
createNewXPathExpresion(XPathVariableResolver aVariableResolver,
String sXPath)
Create a new XPath expression for evaluation using the default
XPathFactory. |
static XPathExpression |
createNewXPathExpresion(XPathVariableResolver aVariableResolver,
XPathFunctionResolver aFunctionResolver,
NamespaceContext aNamespaceContext,
String sXPath)
Create a new XPath expression for evaluation using the default
XPathFactory. |
static XPathFactory |
getDefaultXPathFactory() |
@Nonnull public static XPathFactory getDefaultXPathFactory()
null.@Nonnull public static XPath createNewXPath()
XPath without any special settings using the default
XPathFactory.null XPath object@Nonnull public static XPath createNewXPath(@Nonnull XPathFactory aXPathFactory)
XPath without any special settings.aXPathFactory - The XPath factory object to use. May not be null.null XPath object@Nonnull public static XPath createNewXPath(@Nullable XPathVariableResolver aVariableResolver)
XPath with the passed variable resolver using the
default XPathFactory.aVariableResolver - Variable resolver to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nonnull XPathFactory aXPathFactory, @Nullable XPathVariableResolver aVariableResolver)
XPath with the passed variable resolver.aXPathFactory - The XPath factory object to use. May not be null.aVariableResolver - Variable resolver to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nullable XPathFunctionResolver aFunctionResolver)
XPath with the passed function resolver using the
default XPathFactory.aFunctionResolver - Function resolver to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nonnull XPathFactory aXPathFactory, @Nullable XPathFunctionResolver aFunctionResolver)
XPath with the passed function resolver.aXPathFactory - The XPath factory object to use. May not be null.aFunctionResolver - Function resolver to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nullable NamespaceContext aNamespaceContext)
XPath with the passed namespace context using the
default XPathFactory.aNamespaceContext - Namespace context to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nonnull XPathFactory aXPathFactory, @Nullable NamespaceContext aNamespaceContext)
XPath with the passed namespace context.aXPathFactory - The XPath factory object to use. May not be null.aNamespaceContext - Namespace context to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nullable XPathVariableResolver aVariableResolver, @Nullable NamespaceContext aNamespaceContext)
XPath with the passed variable resolver and namespace
context using the default XPathFactory.aVariableResolver - Variable resolver to be used. May be null.aNamespaceContext - Namespace context to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nullable XPathVariableResolver aVariableResolver, @Nullable XPathFunctionResolver aFunctionResolver, @Nullable NamespaceContext aNamespaceContext)
XPath with the passed variable resolver, function
resolver and namespace context using the default XPathFactory.aVariableResolver - Variable resolver to be used. May be null.aFunctionResolver - Function resolver to be used. May be null.aNamespaceContext - Namespace context to be used. May be null.null XPath object@Nonnull public static XPath createNewXPath(@Nonnull XPathFactory aXPathFactory, @Nullable XPathVariableResolver aVariableResolver, @Nullable XPathFunctionResolver aFunctionResolver, @Nullable NamespaceContext aNamespaceContext)
XPath with the passed variable resolver, function
resolver and namespace context.aXPathFactory - The XPath factory object to use. May not be null.aVariableResolver - Variable resolver to be used. May be null.aFunctionResolver - Function resolver to be used. May be null.aNamespaceContext - Namespace context to be used. May be null.null XPath object@Nonnull public static XPathExpression createNewXPathExpresion(@Nullable XPathVariableResolver aVariableResolver, @Nullable XPathFunctionResolver aFunctionResolver, @Nullable NamespaceContext aNamespaceContext, @Nonnull @Nonempty String sXPath)
XPathFactory.aVariableResolver - Variable resolver to be used. May be null.aFunctionResolver - Function resolver to be used. May be null.aNamespaceContext - Namespace context to be used. May be null.sXPath - The main XPath string to be evaluatedXPathExpression object to be used.IllegalArgumentException - if the XPath cannot be compiled@Nonnull public static XPathExpression createNewXPathExpresion(@Nullable XPathVariableResolver aVariableResolver, @Nonnull @Nonempty String sXPath)
XPathFactory.aVariableResolver - Variable resolver to be used. May be null.sXPath - The main XPath string to be evaluatedXPathExpression object to be used.IllegalArgumentException - if the XPath cannot be compiled@Nonnull public static XPathExpression createNewXPathExpresion(@Nullable XPathFunctionResolver aFunctionResolver, @Nonnull @Nonempty String sXPath)
XPathFactory.aFunctionResolver - Function resolver to be used. May be null.sXPath - The main XPath string to be evaluatedXPathExpression object to be used.IllegalArgumentException - if the XPath cannot be compiled@Nonnull public static XPathExpression createNewXPathExpresion(@Nullable NamespaceContext aNamespaceContext, @Nonnull @Nonempty String sXPath)
XPathFactory.aNamespaceContext - Namespace context to be used. May be null.sXPath - The main XPath string to be evaluatedXPathExpression object to be used.IllegalArgumentException - if the XPath cannot be compiled@Nonnull public static XPathExpression createNewXPathExpresion(@Nonnull @Nonempty String sXPath)
XPathFactoryn.sXPath - The main XPath string to be evaluatedXPathExpression object to be used.IllegalArgumentException - if the XPath cannot be compiled@Nonnull public static XPathExpression createNewXPathExpresion(@Nonnull XPath aXPath, @Nonnull @Nonempty String sXPath)
aXPath - The pre-created XPath object. May not be null.sXPath - The main XPath string to be evaluatedXPathExpression object to be used.IllegalArgumentException - if the XPath cannot be compiledCopyright © 2014–2017 Philip Helger. All rights reserved.