Pom.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:nbreleaseplugin 作者:
/**
 * 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);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号