Search in sources :

Example 6 with XPathException

use of org.javarosa.xpath.XPathException in project javarosa by opendatakit.

the class Triggerable method equals.

public boolean equals(Object o) {
    if (o instanceof Triggerable) {
        Triggerable t = (Triggerable) o;
        if (this == t)
            return true;
        if (this.expr.equals(t.expr)) {
            // the
            try {
                // resolved triggers should match...
                Set<TreeReference> Atriggers = this.getTriggers();
                Set<TreeReference> Btriggers = t.getTriggers();
                return (Atriggers.size() == Btriggers.size()) && Atriggers.containsAll(Btriggers);
            } catch (XPathException e) {
                return false;
            }
        } else {
            return false;
        }
    } else {
        return false;
    }
}
Also used : XPathException(org.javarosa.xpath.XPathException) TreeReference(org.javarosa.core.model.instance.TreeReference) QuickTriggerable(org.javarosa.core.model.QuickTriggerable)

Aggregations

XPathException (org.javarosa.xpath.XPathException)6 TreeReference (org.javarosa.core.model.instance.TreeReference)3 XPathSyntaxException (org.javarosa.xpath.parser.XPathSyntaxException)3 EvaluationContext (org.javarosa.core.model.condition.EvaluationContext)2 DataInstance (org.javarosa.core.model.instance.DataInstance)2 XPathNodeset (org.javarosa.xpath.XPathNodeset)2 XPathExpression (org.javarosa.xpath.expr.XPathExpression)2 ArrayList (java.util.ArrayList)1 DataBinding (org.javarosa.core.model.DataBinding)1 IDataReference (org.javarosa.core.model.IDataReference)1 QuickTriggerable (org.javarosa.core.model.QuickTriggerable)1 Condition (org.javarosa.core.model.condition.Condition)1 Constraint (org.javarosa.core.model.condition.Constraint)1 Recalculate (org.javarosa.core.model.condition.Recalculate)1 TreeElement (org.javarosa.core.model.instance.TreeElement)1 EvaluationResult (org.javarosa.debug.EvaluationResult)1 Event (org.javarosa.debug.Event)1 XPathReference (org.javarosa.model.xform.XPathReference)1 XPathConditional (org.javarosa.xpath.XPathConditional)1 XPathMissingInstanceException (org.javarosa.xpath.XPathMissingInstanceException)1