Package javax.el

Examples of javax.el.ValueReference


                this.jjtGetChild(2) instanceof AstMethodParameters) {
            // This is a method call
            return null;
        }
        Target t = getTarget(ctx);
        return new ValueReference(t.base, t.property);
    }
View Full Code Here


     * @param elCtx
     * @return A ValueReferenceWrapper with the necessary information about the ValueReference.
     */
    public static _ValueReferenceWrapper getUELValueReferenceWrapper(ValueExpression valueExpression, final ELContext elCtx)
    {
        ValueReference valueReference = valueExpression.getValueReference(elCtx);
       
        while (valueReference != null
                && valueReference.getBase() instanceof CompositeComponentExpressionHolder)
        {
            valueExpression = ((CompositeComponentExpressionHolder) valueReference.getBase())
                                  .getExpression((String) valueReference.getProperty());
            if(valueExpression == null)
            {
                break;
            }
            valueReference = valueExpression.getValueReference(elCtx);
        }
       
        if (valueReference != null)
        {
            return new _ValueReferenceWrapper(valueReference.getBase(), valueReference.getProperty());
        }
       
        return null;
    }
View Full Code Here

                this.jjtGetChild(2) instanceof AstMethodParameters) {
            // This is a method call
            return null;
        }
        Target t = getTarget(ctx);
        return new ValueReference(t.base, t.property);
    }
View Full Code Here

     * @return A ValueReferenceWrapper with the necessary information about the ValueReference.
     */
    public static _ValueReferenceWrapper getUELValueReferenceWrapper(ValueExpression valueExpression,
                                                                     final ELContext elCtx)
    {
        ValueReference valueReference = valueExpression.getValueReference(elCtx);
       
        while (valueReference != null
                && valueReference.getBase() instanceof CompositeComponentExpressionHolder)
        {
            valueExpression = ((CompositeComponentExpressionHolder) valueReference.getBase())
                                  .getExpression((String) valueReference.getProperty());
            if(valueExpression == null)
            {
                break;
            }
            valueReference = valueExpression.getValueReference(elCtx);
        }
       
        if (valueReference != null)
        {
            return new _ValueReferenceWrapper(valueReference.getBase(), valueReference.getProperty());
        }
       
        return null;
    }
View Full Code Here

    public static PropertyDescriptor extractPropertyDescriptor(FacesContext context, RequestContext requestContext, ValueExpression ve) {

        if (ve != null) {
            ELContext elContext = context.getELContext();
            ValueReference vr = ValueExpressionAnalyzer.getReference(elContext, ve);
           
            if (vr != null) {
                Validator validator = requestContext.getApplicationContext().getValidatorFactory().getValidator();
                Object base = vr.getBase();
                Object property = vr.getProperty();
               
                if (base != null && property != null) {
                    BeanDescriptor beanDescriptor = validator.getConstraintsForClass(base.getClass());
                   
                    if (beanDescriptor != null) {
View Full Code Here

public class ValueExpressionAnalyzer {

    public static ValueReference getReference(ELContext elContext, ValueExpression expression) {

        ValueReference reference = intercept(elContext, expression);
        if (reference != null) {
            Object base = reference.getBase();
            if (base != null && base instanceof CompositeComponentExpressionHolder) {
                ValueExpression ve = ((CompositeComponentExpressionHolder) base).getExpression((String) reference.getProperty());
                if (ve != null)
                {
                    reference = getReference(elContext, ve);
                }
            }
View Full Code Here

        return reference;
    }

    public static ValueExpression getExpression(ELContext elContext, ValueExpression expression) {

        ValueReference reference = intercept(elContext, expression);
        if (reference != null) {
            Object base = reference.getBase();
            if (base != null && base instanceof CompositeComponentExpressionHolder) {
                ValueExpression ve = ((CompositeComponentExpressionHolder) base).getExpression((String) reference.getProperty());
                if (ve != null)
                {
                    return ve;
                }
            }
View Full Code Here

    @Override
    public void setValue(ELContext context, Object base, Object property, Object value) {
        // currently not used -> see #7114
        if (base != null && property != null) {
            context.setPropertyResolved(true);
            valueReference = new ValueReference(base, property.toString());
        }
    }
View Full Code Here

    }

    @Override
    public Object getValue(ELContext context, Object base, Object property) {
        context.setPropertyResolved(true);
        valueReference = new ValueReference(base, property.toString());

        return delegate.getValue(context, base, property);
    }
View Full Code Here

        // First check the basics work
        String result = (String) ve.getValue(context);
        assertEquals("Tomcat", result);

        // Now check the value reference
        ValueReference vr = ve.getValueReference(context);
        assertNotNull(vr);

        assertEquals(beanB, vr.getBase());
        assertEquals("name", vr.getProperty());
    }
View Full Code Here

TOP

Related Classes of javax.el.ValueReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.