本文整理了Java中javax.xml.xpath.XPath.getXPathVariableResolver()
方法的一些代码示例,展示了XPath.getXPathVariableResolver()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPath.getXPathVariableResolver()
方法的具体详情如下:
包路径:javax.xml.xpath.XPath
类名称:XPath
方法名:getXPathVariableResolver
[英]Return the current variable resolver.
null
is returned in no variable resolver is in effect.
[中]返回当前变量解析器。null
在没有有效变量解析程序的情况下返回。
代码示例来源:origin: org.apache.servicemix/servicemix-core
public XPathVariableResolver getXPathVariableResolver() {
return getXPath().getXPathVariableResolver();
}
代码示例来源:origin: org.xmlbeam/xmlprojector
@Override
final protected Object invokeProjection(final String resolvedXpath, final Object proxy, final Object[] args) throws Throwable {
final XPath xPath = projector.config().createXPath(DOMHelper.getOwnerDocumentFor(node));
if (!lastInvocationContext.isStillValid(resolvedXpath)) {
final DuplexExpression duplexExpression = new DuplexXPathParser(projector.config().getUserDefinedNamespaceMapping()).compile(resolvedXpath);
String strippedXPath = duplexExpression.getExpressionAsStringWithoutFormatPatterns();
MethodParamVariableResolver resolver = null;
if (duplexExpression.isUsingVariables()) {
XPathVariableResolver peviousResolver = xPath.getXPathVariableResolver();
resolver = new MethodParamVariableResolver(method, args, duplexExpression, projector.config().getStringRenderer(), peviousResolver);
xPath.setXPathVariableResolver(resolver);
}
final XPathExpression xPathExpression = xPath.compile(strippedXPath);
final Class<?> targetComponentType = findTargetComponentType(method);
lastInvocationContext = new InvocationContext(resolvedXpath, xPath, xPathExpression, duplexExpression, resolver, targetComponentType, projector);
}
lastInvocationContext.updateMethodArgs(args);
return invokeXpathProjection(lastInvocationContext, proxy, args);
}
代码示例来源:origin: SvenEwald/xmlbeam
@Override
final protected Object invokeProjection(final String resolvedXpath, final Object proxy, final Object[] args) throws Throwable {
final XPath xPath = projector.config().createXPath(DOMHelper.getOwnerDocumentFor(node));
if (!lastInvocationContext.isStillValid(resolvedXpath)) {
final DuplexExpression duplexExpression = new DuplexXPathParser(projector.config().getUserDefinedNamespaceMapping()).compile(resolvedXpath);
String strippedXPath = duplexExpression.getExpressionAsStringWithoutFormatPatterns();
MethodParamVariableResolver resolver = null;
if (duplexExpression.isUsingVariables()) {
XPathVariableResolver peviousResolver = xPath.getXPathVariableResolver();
resolver = new MethodParamVariableResolver(method, args, duplexExpression, projector.config().getStringRenderer(), peviousResolver);
xPath.setXPathVariableResolver(resolver);
}
final XPathExpression xPathExpression = xPath.compile(strippedXPath);
final Class<?> targetComponentType = findTargetComponentType(method);
lastInvocationContext = new InvocationContext(resolvedXpath, xPath, xPathExpression, duplexExpression, resolver, targetComponentType, projector);
}
lastInvocationContext.updateMethodArgs(args);
return invokeXpathProjection(lastInvocationContext, proxy, args);
}
内容来源于网络,如有侵权,请联系作者删除!