Package javax.el

Examples of javax.el.ExpressionFactory.coerceToType()


        if (value == null) return null;

        try
        {
            ExpressionFactory expFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
            return expFactory.coerceToType(value, desiredClass);
        }
        catch (Exception e)
        {
            String message = "Cannot coerce " + value.getClass().getName()
                             + " to " + desiredClass.getName();
View Full Code Here


        if (value == null) return null;

        try
        {
            ExpressionFactory expFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
            return expFactory.coerceToType(value, desiredClass);
        }
        catch (Exception e)
        {
            String message = "Cannot coerce " + value.getClass().getName()
                             + " to " + desiredClass.getName();
View Full Code Here

            setTargetItem((String) value);
        } else if (compare(PropertyKeys.targetPanel, name)) {
            setTargetPanel((String) value);
        } else if (compare(PropertyKeys.disableDefault, name)) {
            ExpressionFactory expFactory = getFacesContext().getApplication().getExpressionFactory();
            setDisableDefault((Boolean) expFactory.coerceToType(value, Boolean.class));
        }
    }
}
View Full Code Here

                Class<?> arrayType = temp.getClass().getComponentType();
                Object result = Array.newInstance(arrayType, target.size());
                for (int i = 0, len = target.size(); i < len; i++) {
                    Array.set(result,
                              i,
                              expFactory.coerceToType(target.get(i),
                                                      arrayType));
                }
                try {
                    pd.getWriteMethod().invoke(bean, result);
                } catch (Exception e) {
View Full Code Here

                    Class<?> arrayType = param[0].getComponentType();
                    Object result = Array.newInstance(arrayType, target.size());
                    for (int i = 0, len = target.size(); i < len; i++) {
                        Array.set(result,
                                  i,
                                  expFactory.coerceToType(target.get(i),
                                                          arrayType));
                    }
                    try {
                        writeMethod.invoke(bean, result);
                    } catch (Exception e) {
View Full Code Here

            ELContext el = faces.getELContext();
            Object valueObj = this.value.getValue(el);
             if (valueObj != null) {
                ExpressionFactory factory =
                      faces.getApplication().getExpressionFactory();
                valueObj = factory.coerceToType(valueObj, target.getType(el));
            }
            this.target.setValue(el, valueObj);
        }

    }
View Full Code Here

                                       Class itemValueType) {

        Object newValue;
        try {
            ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
            newValue = ef.coerceToType(value, itemValueType);
        } catch (ELException ele) {
            newValue = value;
        } catch (IllegalArgumentException iae) {
            // If coerceToType fails, per the docs it should throw
            // an ELException, however, GF 9.0 and 9.0u1 will throw
View Full Code Here

        try {
            Object value = source.getValue(elContext);
            if (value != null) {
                ExpressionFactory factory =
                      facesContext.getApplication().getExpressionFactory();
                value = factory.coerceToType(value, target.getType(elContext));
            }
            target.setValue(elContext, value);
        } catch (ELException ele) {
            throw new AbortProcessingException(ele);
        }
View Full Code Here

        if (value == null) return null;

        try
        {
            ExpressionFactory expFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
            return expFactory.coerceToType(value, desiredClass);
        }
        catch (Exception e)
        {
            String message = "Cannot coerce " + value.getClass().getName()
                             + " to " + desiredClass.getName();
View Full Code Here

        if (value == null) return null;

        try
        {
            ExpressionFactory expFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
            return expFactory.coerceToType(value, desiredClass);
        }
        catch (Exception e)
        {
            String message = "Cannot coerce " + value.getClass().getName()
                             + " to " + desiredClass.getName();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.