{
value = Ognl.getValue(expression, _ognlContext, this);
}
catch (OgnlException ex)
{
throw new DocumentParseException("Expression '" + expression + "' is not valid.", ex);
}
if (value == null)
return false;
if (value instanceof Boolean)
return ((Boolean) value).booleanValue();
if (value instanceof Number)
return ((Number) value).longValue() != 0;
if (value instanceof String)
return ((String) value).length() > 0;
throw new DocumentParseException("Expression '" + expression + "' evaluates to ("
+ value.getClass().getName() + ") " + value
+ ", which cannot be interpreted as a boolean.");
}