Search in sources :

Example 1 with ExpressionChangedException

use of com.dexels.navajo.document.ExpressionChangedException in project navajo by Dexels.

the class DefaultExpressionEvaluator method processRefreshQueue.

// private boolean dependsOn(Property expressionProperty, Property target) {
// 
// }
// 
private final List<Property> processRefreshQueue(List<Property> queue) throws NavajoException {
    Object o = null;
    Object p = null;
    List<Property> refreshQueue = null;
    for (int i = 0; i < queue.size(); i++) {
        Property current = queue.get(i);
        o = current.peekEvaluatedValue();
        try {
            try {
                current.refreshExpression();
            } catch (ExpressionChangedException e) {
            }
        } catch (NavajoException e) {
            logger.info("Expression failed: " + current.getValue());
        } catch (Throwable e) {
            logger.info("Expression changed");
        }
        p = current.peekEvaluatedValue();
        if (o == null && p == null) {
            continue;
        }
        if (o == null || p == null) {
            if (refreshQueue == null) {
                refreshQueue = new ArrayList<Property>();
            }
            refreshQueue.add(current);
            continue;
        }
        // } else {
        if (refreshQueue == null) {
            refreshQueue = new ArrayList<Property>();
        }
        refreshQueue.add(current);
    // }
    }
    if (refreshQueue == null) {
        refreshQueue = new ArrayList<Property>();
    }
    return refreshQueue;
}
Also used : ExpressionChangedException(com.dexels.navajo.document.ExpressionChangedException) NavajoException(com.dexels.navajo.document.NavajoException) Property(com.dexels.navajo.document.Property)

Aggregations

ExpressionChangedException (com.dexels.navajo.document.ExpressionChangedException)1 NavajoException (com.dexels.navajo.document.NavajoException)1 Property (com.dexels.navajo.document.Property)1