try {
Object value = Ognl.getValue(expression, parameterObject);
if (value == null) throw new SqlMapperException("The expression '" +expression+ "' evaluated to a null value.");
if (value instanceof Iterable) return (Iterable) value;
if (value.getClass().isArray()) return Arrays.asList((Object[])value);
throw new BuilderException("Error evaluating expression '"+expression+"'. Return value ("+value+") was not iterable.");
} catch (OgnlException e) {
throw new BuilderException("Error evaluating expression '"+expression+"'. Cause: " + e, e);
}
}