Example usage for org.apache.commons.el Coercions coerceToInteger

List of usage examples for org.apache.commons.el Coercions coerceToInteger

Introduction

In this page you can find the example usage for org.apache.commons.el Coercions coerceToInteger.

Prototype

public static Integer coerceToInteger(Object pValue, Logger pLogger) throws ELException 

Source Link

Document

Coerces a value to an Integer, returning null if the coercion isn't possible.

Usage

From source file:org.apache.myfaces.el.ELParserHelper.java

private static Integer coerceToIntegerWrapper(Object base, Object index)
        throws EvaluationException, ELException {
    Integer integer = Coercions.coerceToInteger(index, LOGGER);
    if (integer != null) {
        return integer;
    }/*from  w ww. ja v  a  2 s . com*/
    throw new ReferenceSyntaxException(
            "Cannot convert index to int for base " + base.getClass().getName() + " and index " + index);
}

From source file:org.seasar.teeda.core.el.impl.commons.CoercionsUtil.java

public static Integer coerceToInteger(Object index, Logger logger) {
    try {// w w w . j a v a2 s  .co  m
        return Coercions.coerceToInteger(index, logger);
    } catch (ELException e) {
        logger_.error(e + " occured at " + CoercionsUtil.class);
        return null;
    }
}