}
}
+ public final static void checkType(final Object obj, final Class type)
+ throws IllegalArgumentException {
+ if (String.class.equals(type)) {
+ coerceToString(obj);
+ }
+ if (ELArithmetic.isNumberType(type)) {
+ coerceToNumber(obj, type);
+ }
+ if (Character.class.equals(type) || Character.TYPE == type) {
+ coerceToCharacter(obj);
+ }
+ if (Boolean.class.equals(type) || Boolean.TYPE == type) {
+ coerceToBoolean(obj);
+ }
+ if (type.isEnum()) {
+ coerceToEnum(obj, type);
+ }
+ }
+
public final static Object coerceToType(final Object obj, final Class type)
throws IllegalArgumentException {
if (type == null || Object.class.equals(type)) {
}
// Check casting
try {
- ELSupport.coerceToType(attrs.getValue(i), expectedClass);
+ ELSupport.checkType(attrs.getValue(i), expectedClass);
} catch (Exception e) {
err.jspError
(n, "jsp.error.coerce_to_type",