/** * * Coerces the given value to the specified class. **/ public static Object coerce (Object pValue, Class pClass, Logger pLogger) throws ELException { if (pClass == String.class) { return coerceToString (pValue, pLogger); } else if (isNumberClass (pClass)) { return coerceToPrimitiveNumber (pValue, pClass, pLogger); } else if (pClass == Character.class || pClass == Character.TYPE) { return coerceToCharacter (pValue, pLogger); } else if (pClass == Boolean.class || pClass == Boolean.TYPE) { return coerceToBoolean (pValue, pLogger); } else { return coerceToObject (pValue, pClass, pLogger); } }
/** * * Coerces the given value to the specified class. **/ public static Object coerce (Object pValue, Class pClass, Logger pLogger) throws ELException { if (pClass == String.class) { return coerceToString (pValue, pLogger); } else if (isNumberClass (pClass)) { return coerceToPrimitiveNumber (pValue, pClass, pLogger); } else if (pClass == Character.class || pClass == Character.TYPE) { return coerceToCharacter (pValue, pLogger); } else if (pClass == Boolean.class || pClass == Boolean.TYPE) { return coerceToBoolean (pValue, pLogger); } else { return coerceToObject (pValue, pClass, pLogger); } }