Package javax.el

Examples of javax.el.ELContext


        }

        try
        {
            final Scope scope = getScope(context);
            final ELContext elcontext = context.getELContext();
            final Application application = context.getApplication();
            if (Scope.Faces.equals(scope))
            {
                return application.getELResolver().getValue(elcontext, null, name);
            }
View Full Code Here


     */

    private _ValueReferenceWrapper getValueReference(final UIComponent component, final FacesContext context)
    {
        final ValueExpression valueExpression = component.getValueExpression("value");
        final ELContext elCtx = context.getELContext();
        if (_ExternalSpecifications.isUnifiedELAvailable())
        {
            // unified el 2.2 is available --> we can use ValueExpression.getValueReference()
           
            // we can't access ValueExpression.getValueReference() directly here, because
View Full Code Here

        {
            return null;
        }
       
        final _ValueReferenceResolver resolver = new _ValueReferenceResolver(elCtx.getELResolver());
        final ELContext elCtxDecorator = new _ELContextDecorator(elCtx, resolver);
       
        valueExpression.getValue(elCtxDecorator);
       
        while (resolver.lastObject.getBase() instanceof CompositeComponentExpressionHolder)
        {
View Full Code Here

    {
        if (component.getChildCount() > 0)
        {
            Map<String, Object> a = component.getAttributes();
            String tag = (String) a.get("alias.element");
            ELContext elContext = context.getELContext();
            UIRepeat repeat = (UIRepeat) component;
            if (tag != null)
            {
                ResponseWriter out = context.getResponseWriter();
                out.startElement(tag, component);
                String[] attrs = (String[]) a.get("alias.attributes");
                String attr;
                if (attrs != null)
                {
                    for (int i = 0; i < attrs.length; i++)
                    {
                        attr = attrs[i];
                        if ("styleClass".equals(attr))
                        {
                            attr = "class";
                        }
                        out.writeAttribute(attr, a.get(attrs[i]), attrs[i]);
                    }
                }
            }
           
            if (repeat.getVarStatus() != null)
            {
                elContext.getELResolver().setValue (elContext, null,
                    repeat.getVarStatus(), repeat.getStatus());
            }
           
            for (UIComponent child : component.getChildren())
            {
View Full Code Here

    }

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
    {
        ELContext elContext = context.getELContext();
        UIRepeat repeat = (UIRepeat) component;
       
        if (repeat.getVarStatus() != null)
        {
            elContext.getELResolver().setValue (elContext, null,
                repeat.getVarStatus(), null);
        }
    }
View Full Code Here

                    else
                    {
                        //EL expression found. Evaluate it and pushback
                        //the result into the stream
                        FacesContext context = FacesContext.getCurrentInstance();
                        ELContext elContext = context.getELContext();
                        ValueExpression ve = context.getApplication().
                            getExpressionFactory().createValueExpression(
                                    elContext,
                                    "#{"+convertToExpression(expressionList)+"}",
                                    String.class);
View Full Code Here

  @Override
  public Object getManagedBean(final String beanName, final FacesContext fc)
  {
    // Find Bean
        final ELContext elcontext = fc.getELContext();
        final Application application = fc.getApplication();
        return application.getELResolver().getValue(elcontext, null, beanName);
  }
View Full Code Here

            this.methodExpZeroArg = methodExpZeroArg;
        }
       
        public void processEvent(ComponentSystemEvent event)
        {
            ELContext elContext = FacesContext.getCurrentInstance().getELContext();
            try
            {
                // first try to invoke the MethodExpression with one argument
                this.methodExpOneArg.invoke(elContext, new Object[] { event });
            }
View Full Code Here

        public void processAction(ActionEvent evt) throws AbortProcessingException
        {
            FacesContext faces = FacesContext.getCurrentInstance();
           
            ELContext el = faces.getELContext();
           
            Object valueObj = _value.getValue(el);
           
            _target.setValue(el, valueObj);
        }
View Full Code Here

*/
public class JuelTest extends TestCase {

    public void testJuel() throws Exception {
        ExpressionFactory factory = ExpressionFactory.newInstance();
        ELContext context  = new SimpleContext();
        ValueExpression valueExpression = factory.createValueExpression(context, "${123 * 2}", Object.class);
        Object value = valueExpression.getValue(context);

        System.out.println("Found: " + value + " for expression: " + valueExpression);
    }
View Full Code Here

TOP

Related Classes of javax.el.ELContext

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.