*/
public abstract class ELArithmetic {
- public final static class BigDecimalDelegate extends ELArithmetic {
+ public static final class BigDecimalDelegate extends ELArithmetic {
@Override
protected Number add(Number num0, Number num1) {
}
}
- public final static class BigIntegerDelegate extends ELArithmetic {
+ public static final class BigIntegerDelegate extends ELArithmetic {
@Override
protected Number add(Number num0, Number num1) {
}
}
- public final static class DoubleDelegate extends ELArithmetic {
+ public static final class DoubleDelegate extends ELArithmetic {
@Override
protected Number add(Number num0, Number num1) {
}
}
- public final static class LongDelegate extends ELArithmetic {
+ public static final class LongDelegate extends ELArithmetic {
@Override
protected Number add(Number num0, Number num1) {
}
}
- public final static BigDecimalDelegate BIGDECIMAL = new BigDecimalDelegate();
+ public static final BigDecimalDelegate BIGDECIMAL = new BigDecimalDelegate();
- public final static BigIntegerDelegate BIGINTEGER = new BigIntegerDelegate();
+ public static final BigIntegerDelegate BIGINTEGER = new BigIntegerDelegate();
- public final static DoubleDelegate DOUBLE = new DoubleDelegate();
+ public static final DoubleDelegate DOUBLE = new DoubleDelegate();
- public final static LongDelegate LONG = new LongDelegate();
+ public static final LongDelegate LONG = new LongDelegate();
- private final static Long ZERO = new Long(0);
+ private static final Long ZERO = new Long(0);
- public final static Number add(final Object obj0, final Object obj1) {
+ public static final Number add(final Object obj0, final Object obj1) {
if (obj0 == null && obj1 == null) {
return new Long(0);
}
return delegate.add(num0, num1);
}
- public final static Number mod(final Object obj0, final Object obj1) {
+ public static final Number mod(final Object obj0, final Object obj1) {
if (obj0 == null && obj1 == null) {
return new Long(0);
}
return delegate.mod(num0, num1);
}
- public final static Number subtract(final Object obj0, final Object obj1) {
+ public static final Number subtract(final Object obj0, final Object obj1) {
if (obj0 == null && obj1 == null) {
return new Long(0);
}
return delegate.subtract(num0, num1);
}
- public final static Number divide(final Object obj0, final Object obj1) {
+ public static final Number divide(final Object obj0, final Object obj1) {
if (obj0 == null && obj1 == null) {
return ZERO;
}
return delegate.divide(num0, num1);
}
- public final static Number multiply(final Object obj0, final Object obj1) {
+ public static final Number multiply(final Object obj0, final Object obj1) {
if (obj0 == null && obj1 == null) {
return new Long(0);
}
return delegate.multiply(num0, num1);
}
- public final static boolean isNumber(final Object obj) {
+ public static final boolean isNumber(final Object obj) {
return (obj != null && isNumberType(obj.getClass()));
}
- public final static boolean isNumberType(final Class<?> type) {
+ public static final boolean isNumberType(final Class<?> type) {
return type == Long.TYPE || type == Double.TYPE ||
type == Byte.TYPE || type == Short.TYPE ||
type == Integer.TYPE || type == Float.TYPE ||
*/
public class ELSupport {
- private final static Long ZERO = new Long(0L);
+ private static final Long ZERO = new Long(0L);
- public final static void throwUnhandled(Object base, Object property)
+ public static final void throwUnhandled(Object base, Object property)
throws ELException {
if (base == null) {
throw new PropertyNotFoundException(MessageFactory.get(
* @throws ELException if neither object is Comparable
* @throws ClassCastException if the objects are not mutually comparable
*/
- public final static int compare(final Object obj0, final Object obj1)
+ public static final int compare(final Object obj0, final Object obj1)
throws ELException {
if (obj0 == obj1 || equals(obj0, obj1)) {
return 0;
* @return true if the objects are equal
* @throws ELException
*/
- public final static boolean equals(final Object obj0, final Object obj1)
+ public static final boolean equals(final Object obj0, final Object obj1)
throws ELException {
if (obj0 == obj1) {
return true;
}
}
- public final static Enum<?> coerceToEnum(final Object obj, Class type) {
+ public static final Enum<?> coerceToEnum(final Object obj, Class type) {
if (obj == null || "".equals(obj)) {
return null;
}
* @return the Boolean value of the object
* @throws ELException if object is not Boolean or String
*/
- public final static Boolean coerceToBoolean(final Object obj)
+ public static final Boolean coerceToBoolean(final Object obj)
throws ELException {
if (obj == null || "".equals(obj)) {
return Boolean.FALSE;
obj, obj.getClass(), Boolean.class));
}
- public final static Character coerceToCharacter(final Object obj)
+ public static final Character coerceToCharacter(final Object obj)
throws ELException {
if (obj == null || "".equals(obj)) {
return new Character((char) 0);
obj, objType, Character.class));
}
- public final static Number coerceToNumber(final Object obj) {
+ public static final Number coerceToNumber(final Object obj) {
if (obj == null) {
return ZERO;
} else if (obj instanceof Number) {
}
}
- protected final static Number coerceToNumber(final Number number,
+ protected static final Number coerceToNumber(final Number number,
final Class<?> type) throws ELException {
if (Long.TYPE == type || Long.class.equals(type)) {
return new Long(number.longValue());
number, number.getClass(), type));
}
- public final static Number coerceToNumber(final Object obj,
+ public static final Number coerceToNumber(final Object obj,
final Class<?> type) throws ELException {
if (obj == null || "".equals(obj)) {
return coerceToNumber(ZERO, type);
obj, obj.getClass(), type));
}
- protected final static Number coerceToNumber(final String val,
+ protected static final Number coerceToNumber(final String val,
final Class<?> type) throws ELException {
if (Long.TYPE == type || Long.class.equals(type)) {
try {
* @param obj
* @return the String value of the object
*/
- public final static String coerceToString(final Object obj) {
+ public static final String coerceToString(final Object obj) {
if (obj == null) {
return "";
} else if (obj instanceof String) {
}
}
- public final static Object coerceToType(final Object obj,
+ public static final Object coerceToType(final Object obj,
final Class<?> type) throws ELException {
if (type == null || Object.class.equals(type) ||
(obj != null && type.isAssignableFrom(obj.getClass()))) {
* @param obj array to be checked
* @return true if the array contains a {@code null}
*/
- public final static boolean containsNulls(final Object[] obj) {
+ public static final boolean containsNulls(final Object[] obj) {
for (int i = 0; i < obj.length; i++) {
if (obj[0] == null) {
return true;
return false;
}
- public final static boolean isBigDecimalOp(final Object obj0,
+ public static final boolean isBigDecimalOp(final Object obj0,
final Object obj1) {
return (obj0 instanceof BigDecimal || obj1 instanceof BigDecimal);
}
- public final static boolean isBigIntegerOp(final Object obj0,
+ public static final boolean isBigIntegerOp(final Object obj0,
final Object obj1) {
return (obj0 instanceof BigInteger || obj1 instanceof BigInteger);
}
- public final static boolean isDoubleOp(final Object obj0, final Object obj1) {
+ public static final boolean isDoubleOp(final Object obj0, final Object obj1) {
return (obj0 instanceof Double
|| obj1 instanceof Double
|| obj0 instanceof Float
|| obj1 instanceof Float);
}
- public final static boolean isDoubleStringOp(final Object obj0,
+ public static final boolean isDoubleStringOp(final Object obj0,
final Object obj1) {
return (isDoubleOp(obj0, obj1)
|| (obj0 instanceof String && isStringFloat((String) obj0)) || (obj1 instanceof String && isStringFloat((String) obj1)));
}
- public final static boolean isLongOp(final Object obj0, final Object obj1) {
+ public static final boolean isLongOp(final Object obj0, final Object obj1) {
return (obj0 instanceof Long
|| obj1 instanceof Long
|| obj0 instanceof Integer
|| obj1 instanceof Byte);
}
- public final static boolean isStringFloat(final String str) {
+ public static final boolean isStringFloat(final String str) {
int len = str.length();
if (len > 1) {
for (int i = 0; i < len; i++) {
return false;
}
- public final static Number toFloat(final String value) {
+ public static final Number toFloat(final String value) {
try {
if (Double.parseDouble(value) > Double.MAX_VALUE) {
return new BigDecimal(value);
}
}
- public final static Number toNumber(final String value) {
+ public static final Number toNumber(final String value) {
try {
return new Integer(Integer.parseInt(value));
} catch (NumberFormatException e0) {