/**
* Find the element reference for the selected element. The selected element
* is an XPATH expression relation to the element reference given as a
* parameter.
*
* @param pev the element reference from which the XPATH expression is
* evaluated.
* @param path the XPATH expression
* @return the resulting element reference
*/
public final ElementValue findElementValue(ElementValue pev, String path) {
XPath xpath = XPathFactory.newInstance().newXPath();
try {
Element el = (Element) xpath.evaluate(path, pev.getElement(), XPathConstants.NODE);
return pev.isInHerited()
? (el == null
? new ElementValue(Type.INHERITED_MISSING)
: new ElementValue(el, Type.INHERITED))
: (el == null
? new ElementValue(pev, path)
: new ElementValue(el, Type.OK));
} catch (XPathExpressionException ex) {
return new ElementValue(pev, path);
}
}
Pom.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:nbreleaseplugin
作者:
评论列表
文章目录