public static Object makeExpressionPayload ( String expr ) throws IllegalArgumentException, IllegalAccessException, Exception { FacesContextImpl fc = new FacesContextImpl((ServletContext) null, (ServletRequest) null, (ServletResponse) null); ELContext elContext = new FacesELContext(new CompositeELResolver(), fc); Reflections.getField(FacesContextImplBase.class, "_elContext").set(fc, elContext); ExpressionFactory expressionFactory = ExpressionFactory.newInstance(); ValueExpression ve1 = expressionFactory.createValueExpression(elContext, expr, Object.class); ValueExpressionMethodExpression e = new ValueExpressionMethodExpression(ve1); ValueExpression ve2 = expressionFactory.createValueExpression(elContext, "${true}", Object.class); ValueExpressionMethodExpression e2 = new ValueExpressionMethodExpression(ve2); return Gadgets.makeMap(e2, e); }
@Override public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public boolean isReadOnly(final Object base, final Object property) { return invokeResolver(new ResolverInvoker<Boolean>(base, property) { @Override public Boolean invoke(ELResolver resolver, ELContext context) { return Boolean.valueOf(getELResolver().isReadOnly(getELContext(), base, property)); } }); }
@Override String getMessage() { return super.getMessage() + " newValue: '" + newValue + "'"; } });
@Override public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public boolean isReadOnly(final Object base, final Object property) { return invokeResolver(new ResolverInvoker<Boolean>(base, property) { public Boolean invoke(ELResolver resolver, ELContext context) { return Boolean.valueOf(getELResolver().isReadOnly(getELContext(), base, property)); } }); }
@Override String getMessage() { return super.getMessage() + " newValue: '" + newValue + "'"; } });
@Override public boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return false; }
@Override public boolean isReadOnly(final Object base, final Object property) { return invokeResolver(new ResolverInvoker<Boolean>(base, property) { @Override public Boolean invoke(ELResolver resolver, ELContext context) { return Boolean.valueOf(getELResolver().isReadOnly(getELContext(), base, property)); } }); }
@Override public Class getType(Object base, int index) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); }
@Override public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return false; }
@Override public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return null; }
@Override public boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); return false; }
@Override public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException { updatePropertyResolved(); }