Example usage for org.apache.commons.jxpath JXPathException printStackTrace

List of usage examples for org.apache.commons.jxpath JXPathException printStackTrace

Introduction

In this page you can find the example usage for org.apache.commons.jxpath JXPathException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.idega.chiba.web.xml.xforms.ui.IdegaText.java

protected boolean evalCondition(Element action, String ifCondition) {
    //get the global XPath context
    JXPathContext context = this.model.getDefaultInstance().getInstanceContext();

    Boolean b;/*from   w  ww  .  j  a va  2s. co m*/
    //get the right current context - if we're not bound we've to walk up to get it
    String currentPath = getParentContextPath(action);
    if (currentPath == null) {
        //try to evaluate ifCondition without context -> it may contain an absolute locationpath
        try {
            b = (Boolean) context.getValue(ifCondition);
        } catch (JXPathException jxe) {
            jxe.printStackTrace();
            return true; //default to true behaving as if the if attribute weren't there and therefore executing the action
        }
    } else {
        String expr = XPathUtil.joinStep(new String[] { currentPath, ifCondition });
        b = (Boolean) context.getValue("boolean(" + expr + ")");
    }
    return b.booleanValue();
}