Example usage for org.apache.commons.jxpath.ri Compiler AXIS_ATTRIBUTE

List of usage examples for org.apache.commons.jxpath.ri Compiler AXIS_ATTRIBUTE

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri Compiler AXIS_ATTRIBUTE.

Prototype

int AXIS_ATTRIBUTE

To view the source code for org.apache.commons.jxpath.ri Compiler AXIS_ATTRIBUTE.

Click Source Link

Usage

From source file:org.openvpms.component.system.common.jxpath.OpenVPMSTreeCompiler.java

/**
 * Copy from base class to support extension. The base class method
 * should've been marked as protected/*from   ww w .  ja  v  a2  s. co m*/
 * 
 * @param arg
 * @return
 */
private boolean isNameAttributeTest(Expression arg) {
    if (!(arg instanceof LocationPath)) {
        return false;
    }

    Step[] steps = ((LocationPath) arg).getSteps();
    if (steps.length != 1) {
        return false;
    }
    if (steps[0].getAxis() != Compiler.AXIS_ATTRIBUTE) {
        return false;
    }
    NodeTest test = steps[0].getNodeTest();
    if (!(test instanceof NodeNameTest)) {
        return false;
    }
    if (!((NodeNameTest) test).getNodeName().equals(QNAME_NAME)) {
        return false;
    }
    return true;
}