Package javax.faces.el

Examples of javax.faces.el.PropertyResolver


        {
            return base.getClass();
        }

        // Resolve the property names
        PropertyResolver pr = application().getPropertyResolver();
        for (int i = 1; i < names.size() - 1; i++)
        {
            base = pr.getValue(base, (String) names.get(i));
        }

        // Return the type of the final property
        return pr.getType(base, (String) names.get(names.size() - 1));

    }
View Full Code Here


        return false; // if there is no data in the table then nothing is sortable

      Object data = _model.getRowData();
      try
      {
        PropertyResolver resolver = __getPropertyResolver();
        Object propertyValue = evaluateProperty(resolver, data, property);

        // when the value is null, we don't know if we can sort it.
        // by default let's support sorting of null values, and let the user
        // turn off sorting if necessary:
View Full Code Here

            else
            {
                Object[] baseAndProperty = (Object[]) base_;
                Object base      = baseAndProperty[0];
                Object property  = baseAndProperty[1];
                PropertyResolver propertyResolver =
                    _application.getPropertyResolver();

                Integer index = ELParserHelper.toIndex(base, property);
                if (index == null)
                {
                    Class clazz = propertyResolver.getType(base, property);
                    propertyResolver.setValue(
                        base, property, coerce(newValue, clazz));
                }
                else
                {
                    int indexVal = index.intValue();
                    Class clazz = propertyResolver.getType(base, indexVal);
                    propertyResolver.setValue(
                        base, indexVal, coerce(newValue, clazz));
                }
            }
        }
        catch (IndexOutOfBoundsException e)
View Full Code Here

                }
                prevInChain = Util.createInstance(values[i],
                                               PropertyResolver.class,
                                               prevInChain);
            }
            PropertyResolver legacyPRChainHead= (PropertyResolver) prevInChain;
            if (associate != null) {
                associate.setLegacyPRChainHead(legacyPRChainHead);
            }
        }
       
View Full Code Here

     return the <code>DummyPropertyResolverImpl</code>.
     */
    public static PropertyResolver getDelegatePR(ApplicationAssociate associate,
                                                 boolean provideDefault)  {

        PropertyResolver pr = associate.getLegacyPropertyResolver();
        if (pr == null) {
            pr = associate.getLegacyPRChainHead();
            if (pr == null && provideDefault) {
                pr = new DummyPropertyResolverImpl();
            }
View Full Code Here

     * @param associate our ApplicationAssociate
     */
    private static void addPropertyResolvers(CompositeELResolver target,
                                             ApplicationAssociate associate) {

        PropertyResolver pr = getDelegatePR(associate, false);
        if (pr != null) {
            target.add(new PropertyResolverChainWrapper(pr));
        }

    }
View Full Code Here

    private PropertyResolver createPropertyResolver() {

        ApplicationFactory factory = (ApplicationFactory)
            FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        Application application = factory.getApplication();
        PropertyResolver resolver =
            new PropertyResolverImpl(application.getPropertyResolver());
        application.setPropertyResolver(resolver);
        return (resolver);

    }
View Full Code Here

                   (navigationHandler1 == navigationHandler3));

        // 3. Verify "getPropertyResolver" returns the same PropertyResolver
        //    instance if called multiple times.
        //
        PropertyResolver propertyResolver1 = application.getPropertyResolver();
        PropertyResolver propertyResolver2 = application.getPropertyResolver();
        PropertyResolver propertyResolver3 = application.getPropertyResolver();
        assertTrue((propertyResolver1 == propertyResolver2) &&
                   (propertyResolver1 == propertyResolver3));

        // 4. Verify "getVariableResolver" returns the same VariableResolver
        //    instance if called multiple times.
View Full Code Here

                FactoryFinder.APPLICATION_FACTORY);
        application = (ApplicationImpl) aFactory.getApplication();

        ActionListener actionListener = null;
        NavigationHandler navHandler = null;
        PropertyResolver propResolver = null;
        VariableResolver varResolver = null;
        ViewHandler viewHandler = null;
        StateManager stateManager = null;

        assertTrue(null != (actionListener =
View Full Code Here

    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();

    // see if we need to take action-
    if (null == context.getExternalContext().getSessionMap().get("systest.replacePropertyResolver")) {
        final PropertyResolver oldProp = app.getPropertyResolver();
        PropertyResolver
        newProp = new PropertyResolver() {
            public Object getValue(Object base, Object property)
            throws EvaluationException, PropertyNotFoundException {
            return oldProp.getValue(base, property);
            }
View Full Code Here

TOP

Related Classes of javax.faces.el.PropertyResolver

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.