protected Object coerceToModelType(FacesContext ctx, Object value, Class itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException | IllegalArgumentException ele) { newValue = value; } return newValue; }
public static Object convertToTypeNoLogging(FacesContext facesContext, Object value, Class<?> desiredClass) throws Exception { if (value == null) { return null; } ExpressionFactory expFactory = facesContext.getApplication().getExpressionFactory(); return expFactory.coerceToType(value, desiredClass); }
public static Object convertToTypeNoLogging(FacesContext facesContext, Object value, Class<?> desiredClass) throws Exception { if (value == null) { return null; } ExpressionFactory expFactory = facesContext.getApplication().getExpressionFactory(); return expFactory.coerceToType(value, desiredClass); }
private Object coerceToModelType(FacesContext ctx, Object value, Class<? extends Object> itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException ele) { newValue = value; } catch (IllegalArgumentException iae) { newValue = value; } return newValue; }
private Object coerceToModelType(FacesContext ctx, Object value, Class<? extends Object> itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException ele) { newValue = value; } catch (IllegalArgumentException iae) { newValue = value; } return newValue; }
protected Object coerceToModelType(FacesContext ctx, Object value, Class<?> itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException | IllegalArgumentException ele) { // If coerceToType fails, per the docs it should throw // an ELException, however, GF 9.0 and 9.0u1 will throw // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
protected Object coerceToModelType(FacesContext ctx, Object value, Class<?> itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException | IllegalArgumentException ele) { // If coerceToType fails, per the docs it should throw // an ELException, however, GF 9.0 and 9.0u1 will throw // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
protected Object coerceToModelType(FacesContext ctx, Object value, Class<?> itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException | IllegalArgumentException ele) { // If coerceToType fails, per the docs it should throw // an ELException, however, GF 9.0 and 9.0u1 will throw // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
public static Object coerce(Object value, Class<?> toType) { FacesContext context = FacesContext.getCurrentInstance(); return context.getApplication().getExpressionFactory().coerceToType(value, toType); }
protected Object coerceToModelType(FacesContext ctx, Object value, Class itemValueType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, itemValueType); } catch (ELException ele) { newValue = value; } catch (IllegalArgumentException iae) { newValue = value; } return newValue; }
public static Object coerce(Object value, Class<?> toType) { FacesContext context = FacesContext.getCurrentInstance(); return context.getApplication().getExpressionFactory().coerceToType(value, toType); }
public static Object coerce(Object value, Class<?> toType) { FacesContext context = FacesContext.getCurrentInstance(); return context.getApplication().getExpressionFactory().coerceToType(value, toType); }
public static Object coerce(Object value, Class<?> toType) { FacesContext context = FacesContext.getCurrentInstance(); return context.getApplication().getExpressionFactory().coerceToType(value, toType); }
protected Object coerceToModelType(FacesContext ctx, Object value, 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 // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
protected Object coerceToModelType(FacesContext ctx, Object value, 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 // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
protected Object coerceToModelType(FacesContext ctx, Object value, 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 // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
/** * Coerce the provided value to the specified type using EL coercion. * * @param ctx the {@link FacesContext} for the current request * @param value the value to coerce * @param toType the type <code>value</code> should be coerced to * * @return the result of the EL coersion * * @see ExpressionFactory#coerceToType(Object, Class) */ private static Object coerceToModelType(FacesContext ctx, Object value, Class toType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, toType); } catch (ELException | IllegalArgumentException ele) { // If coerceToType fails, per the docs it should throw // an ELException, however, GF 9.0 and 9.0u1 will throw // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
/** * Coerce the provided value to the specified type using EL coercion. * * @param ctx the {@link FacesContext} for the current request * @param value the value to coerce * @param toType the type <code>value</code> should be coerced to * * @return the result of the EL coersion * * @see ExpressionFactory#coerceToType(Object, Class) */ private static Object coerceToModelType(FacesContext ctx, Object value, Class toType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, toType); } catch (ELException | IllegalArgumentException ele) { // If coerceToType fails, per the docs it should throw // an ELException, however, GF 9.0 and 9.0u1 will throw // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
/** * Coerce the provided value to the specified type using EL coercion. * * @param ctx the {@link FacesContext} for the current request * @param value the value to coerce * @param toType the type <code>value</code> should be coerced to * * @return the result of the EL coersion * * @see ExpressionFactory#coerceToType(Object, Class) */ private static Object coerceToModelType(FacesContext ctx, Object value, Class toType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, toType); } catch (ELException | IllegalArgumentException ele) { // If coerceToType fails, per the docs it should throw // an ELException, however, GF 9.0 and 9.0u1 will throw // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }
/** * Coerce the provided value to the specified type using EL coercion. * * @param ctx the {@link FacesContext} for the current request * @param value the value to coerce * @param toType the type <code>value</code> should be coerced to * * @return the result of the EL coersion * * @see ExpressionFactory#coerceToType(Object, Class) */ private static Object coerceToModelType(FacesContext ctx, Object value, Class toType) { Object newValue; try { ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); newValue = ef.coerceToType(value, toType); } 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 // an IllegalArgumentException instead (see GF issue 1527). newValue = value; } return newValue; }