Package javax.faces.el

Examples of javax.faces.el.PropertyNotFoundException


    public Class getType(Object base, int index)
    {
        if (base == null)
        {
            throw new PropertyNotFoundException("Bean is null");
        }

        try
        {
            if (base.getClass().isArray())
            {
                if (base instanceof Object[]) {
                    Object[] array = (Object[]) base;
                    return array[index].getClass().getComponentType();
                } else {
                    return base.getClass().getComponentType();
                }
            }

            if (base instanceof List)
            {
                // REVISIT: does it make sense to do this or simply return
                //          Object.class? What if the new value is not of
                //          the old value's class?
                Object value = ((List) base).get(index);

                // REVISIT: when generics are implemented in JVM 1.5
                return (value != null) ? value.getClass() : Object.class;
            }

            // Cannot determine type, return null per JSF spec
            return null;
        }
        catch (IndexOutOfBoundsException e) {
            throw new PropertyNotFoundException("Bean: "
                + base.getClass().getName() + ", index " + index, e);
        }
        catch (Exception e)
        {
            throw new EvaluationException("Exception getting type of index " + index + " of bean "
View Full Code Here


            getPropertyDescriptor(base, name);

        Method m = propertyDescriptor.getWriteMethod();
        if (m == null)
        {
            throw new PropertyNotFoundException(
                "Bean: " + base.getClass().getName() + ", property: " + name);
        }

        // Check if the concrete class of this method is accessible and if not
        // search for a public interface that declares this method
        m = MethodUtils.getAccessibleMethod(m);
        if (m == null)
        {
            throw new PropertyNotFoundException(
                "Bean: " + base.getClass().getName() + ", property: " + name + " (not accessible!)");
        }

        try
        {
View Full Code Here

            getPropertyDescriptor(base, name);

        Method m = propertyDescriptor.getReadMethod();
        if (m == null)
        {
            throw new PropertyNotFoundException(
                "Bean: " + base.getClass().getName() + ", property: " + name);
        }

        // Check if the concrete class of this method is accessible and if not
        // search for a public interface that declares this method
        m = MethodUtils.getAccessibleMethod(m);
        if (m == null)
        {
            throw new PropertyNotFoundException(
                "Bean: " + base.getClass().getName() + ", property: " + name + " (not accessible!)");
        }

        try
        {
View Full Code Here

                getPropertyDescriptor(
                    Introspector.getBeanInfo(base.getClass()), name);
        }
        catch (IntrospectionException e)
        {
            throw new PropertyNotFoundException("Bean: "
                + base.getClass().getName() + ", property: " + name, e);
        }

        return propertyDescriptor;
    }
View Full Code Here

                if (propDescriptors[i].getName().equals(propertyName))
                    return propDescriptors[i];
            }
        }

        throw new PropertyNotFoundException("Bean: "
            + beanInfo.getBeanDescriptor().getBeanClass().getName()
            + ", property: " + propertyName);
    }
View Full Code Here

            if (base instanceof Map) {
                Map map = (Map) base;
                if (map.containsKey(name)) {
                    return (map.get(name));
                } else {
                    throw new PropertyNotFoundException(name);
                }
            } else {
                return (PropertyUtils.getSimpleProperty(base, name));
            }
        } catch (IllegalAccessException e) {
            throw new EvaluationException(e);
        } catch (InvocationTargetException e) {
            throw new EvaluationException(e.getTargetException());
        } catch (NoSuchMethodException e) {
            throw new PropertyNotFoundException(name);
        }

    }
View Full Code Here

        } catch (IllegalAccessException e) {
            throw new EvaluationException(e);
        } catch (InvocationTargetException e) {
            throw new EvaluationException(e.getTargetException());
        } catch (NoSuchMethodException e) {
            throw new PropertyNotFoundException(name);
        }

    }
View Full Code Here

    @Override
    public void setValue(final Object base, final Object property, final Object newValue) throws EvaluationException,
        PropertyNotFoundException
    {
        if (base == null || property == null || isReadOnly (base, property))
            throw new PropertyNotFoundException();

        invokeResolver(new ResolverInvoker<Object>(base, property)
        {
            @Override
            public Object invoke(ELResolver resolver, ELContext context)
View Full Code Here

    @Override
    public void setValue(Object base, int index, Object newValue) throws EvaluationException, PropertyNotFoundException
    {
        if (base == null)
            throw new PropertyNotFoundException();

        if (base instanceof Object[])
        {
            if (index < 0 || index >= ((Object[])base).length)
            {
                throw new PropertyNotFoundException();
            }
        }
        else if (base instanceof List)
        {
            if (index < 0 || index >= ((List<?>)base).size())
            {
                throw new PropertyNotFoundException();
            }
        }

        setValue(base, Integer.valueOf(index), newValue);
    }
View Full Code Here

    @Override
    public Class getType(final Object base, final Object property)
    {
        if (base == null || property == null)
            throw new PropertyNotFoundException();

        return invokeResolver(new ResolverInvoker<Class<?>>(base, property)
        {
            @Override
            public Class<?> invoke(final ELResolver resolver, final ELContext context)
View Full Code Here

TOP

Related Classes of javax.faces.el.PropertyNotFoundException

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.