context.setPropertyResolved(false); for (int i = 0, l = resolvers.size(); i < l; i++) { Class<?> type = resolvers.get(i).getType(context, base, property); if (context.isPropertyResolved()) { return type;
@Override public Class<?> getType(Bindings bindings, ELContext context) { ValueExpression expression = bindings.getVariable(index); if (expression != null) { return expression.getType(context); } context.setPropertyResolved(false); Class<?> result = context.getELResolver().getType(context, null, name); if (!context.isPropertyResolved()) { throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name)); } return result; }
@Override public void setValue(Bindings bindings, ELContext context, Object value) { ValueExpression expression = bindings.getVariable(index); if (expression != null) { expression.setValue(context, value); return; } context.setPropertyResolved(false); Class<?> type = context.getELResolver().getType(context, null, name); if (context.isPropertyResolved()) { if (type != null && (value != null || type.isPrimitive())) { value = bindings.convert(value, type); } context.setPropertyResolved(false); } context.getELResolver().setValue(context, null, name, value); if (!context.isPropertyResolved()) { throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name)); } }
@Override public Class<?> getType(Bindings bindings, ELContext context) { if (!lvalue) { return null; } Object base = prefix.eval(bindings, context); if (base == null) { throw new PropertyNotFoundException(LocalMessages.get("error.property.base.null", prefix)); } Object property = getProperty(bindings, context); if (property == null && strict) { throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", "null", base)); } context.setPropertyResolved(false); Class<?> result = context.getELResolver().getType(context, base, property); if (!context.isPropertyResolved()) { throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", property, base)); } return result; }
@Override public void setValue(Bindings bindings, ELContext context, Object value) throws ELException { if (!lvalue) { throw new ELException(LocalMessages.get("error.value.set.rvalue", getStructuralId(bindings))); } Object base = prefix.eval(bindings, context); if (base == null) { throw new PropertyNotFoundException(LocalMessages.get("error.property.base.null", prefix)); } Object property = getProperty(bindings, context); if (property == null && strict) { throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", "null", base)); } context.setPropertyResolved(false); Class<?> type = context.getELResolver().getType(context, base, property); if (context.isPropertyResolved()) { if (type != null && (value != null || type.isPrimitive())) { value = bindings.convert(value, type); } context.setPropertyResolved(false); } context.getELResolver().setValue(context, base, property, value); if (!context.isPropertyResolved()) { throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", property, base)); } }