Package javax.el

Examples of javax.el.ELResolver


    /**
     * Factory method to create the EL context
     */
    protected ELContext createContext() {
        ELResolver resolver = new CompositeELResolver() {
            {
                //add(methodResolver);
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
View Full Code Here


public class LocalCurrentUserInfo implements CurrentUserInfo {

    @Override
    public String getCurrentUser() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ELResolver elResolver = FacesContext.getCurrentInstance().getApplication().getELResolver();
        Object o = elResolver.getValue(facesContext.getELContext(), null, "currentUser");
        CurrentUser user = (CurrentUser) o;

//        facesContext.getExternalContext().getSessionMap().get("cmfCurrentUser");

        return user == null ? null : user.getUser();
View Full Code Here

    /**
     * Factory method to create the EL context
     */
    protected ELContext createContext() {
        ELResolver resolver = new CompositeELResolver() {
            {
                //add(methodResolver);
                add(new ArrayELResolver(false));
                add(new ListELResolver(false));
                add(new MapELResolver(false));
View Full Code Here

      resolvers.add(new ImplicitFlowVariableELResolver(context));
      resolvers.add(new ScopeSearchingELResolver(context));
      resolvers.add(new SpringBeanWebFlowELResolver(context));
      resolvers.add(new ActionMethodELResolver());
      resolvers.add(new ZkELResolver()); //resolve ZK variables and implicit object
      final ELResolver resolver = new DefaultELResolver(resolvers);
      return new ZkWebFlowELContext(resolver);
    }
View Full Code Here

            propCount--;
        }
        int i = 1;

        // evaluate any properties before our target
        ELResolver resolver = ctx.getELResolver();
        if (propCount > 1) {
            while (base != null && i < propCount) {
                property = this.children[i].getValue(ctx);
                ctx.setPropertyResolved(false);
                base = resolver.getValue(ctx, base, property);
                i++;
            }
            // if we are in this block, we have more properties to resolve,
            // but our base was null
            if (base == null || property == null) {
View Full Code Here

    public Object getValue(EvaluationContext ctx) throws ELException {
        Object base = this.children[0].getValue(ctx);
        int propCount = this.jjtGetNumChildren();
        int i = 1;
        Object suffix = null;
        ELResolver resolver = ctx.getELResolver();
        while (base != null && i < propCount) {
            suffix = this.children[i].getValue(ctx);
            if (i + 1 < propCount &&
                    (this.children[i+1] instanceof AstMethodParameters)) {
                AstMethodParameters mps =
                    (AstMethodParameters) this.children[i+1];
                // This is a method
                base = resolver.invoke(ctx, base, suffix, null,
                        mps.getParameters(ctx));
                i+=2;
            } else {
                // This is a property
                if (suffix == null) {
                    return null;
                }
               
                ctx.setPropertyResolved(false);
                base = resolver.getValue(ctx, base, suffix);
                i++;
            }
        }
        if (!ctx.isPropertyResolved()) {
            throw new PropertyNotFoundException(MessageFactory.get(
View Full Code Here

    @Override
    public void setValue(EvaluationContext ctx, Object value)
            throws ELException {
        Target t = getTarget(ctx);
        ctx.setPropertyResolved(false);
        ELResolver resolver = ctx.getELResolver();

        // coerce to the expected type
        Class<?> targetClass = resolver.getType(ctx, t.base, t.property);
        if (COERCE_TO_ZERO == true
                || !isAssignable(value, targetClass)) {
            resolver.setValue(ctx, t.base, t.property,
                    ELSupport.coerceToType(value, targetClass));
        } else {
            resolver.setValue(ctx, t.base, t.property, value);
        }
        if (!ctx.isPropertyResolved()) {
            throw new PropertyNotFoundException(MessageFactory.get(
                    "error.resolver.unhandled", t.base, t.property));           
        }
View Full Code Here

      customResolvers.add(new ImplicitFlowVariableELResolver(context));
      customResolvers.add(new ScopeSearchingELResolver(context));
      customResolvers.add(new SpringBeanWebFlowELResolver(context));
      customResolvers.add(new ActionMethodELResolver());
      customResolvers.add(new JsfManagedBeanResolver());
      ELResolver resolver = new DefaultELResolver(customResolvers);
      return new WebFlowELContext(resolver);
    }
View Full Code Here

        List<BeanEntry> injectedBeansAndMetaData =
                (List<BeanEntry>)_externalContext.getApplicationMap().get(INJECTED_BEAN_STORAGE_KEY);

        for (String className : dispenser.getElResolvers())
        {
            ELResolver elResolver = (ELResolver) ClassUtils.newInstance(className, ELResolver.class);
            try
            {
                Object creationMetaData = getInjectionProvider().inject(elResolver);

                injectedBeansAndMetaData.add(new BeanEntry(elResolver, creationMetaData));
View Full Code Here

        if (STATIC_FIELD_EL_RESOLVER_CLASS != null &&
            GET_STREAM_EL_RESOLVER_METHOD != null)
        {
            try
            {
                ELResolver streamElResolver = (ELResolver) GET_STREAM_EL_RESOLVER_METHOD.invoke(
                        getRuntimeConfig().getExpressionFactory());
                if (streamElResolver != null)
                {
                    // By default return null, but in a EL 3 implementation it should be there,
                    // this is just to avoid exceptions in junit testing
View Full Code Here

TOP

Related Classes of javax.el.ELResolver

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.