super();
}
- public Object coerceToType(Object obj, Class type) {
+ public Object coerceToType(Object obj, Class<?> type) {
return ELSupport.coerceToType(obj, type);
}
}
public ValueExpression createValueExpression(ELContext context,
- String expression, Class expectedType) {
+ String expression, Class<?> expectedType) {
if (expectedType == null) {
throw new NullPointerException(MessageFactory
.get("error.value.expectedType"));
}
public ValueExpression createValueExpression(Object instance,
- Class expectedType) {
+ Class<?> expectedType) {
if (expectedType == null) {
throw new NullPointerException(MessageFactory
.get("error.value.expectedType"));
public final class MethodExpressionImpl extends MethodExpression implements
Externalizable {
- private Class expectedType;
+ private Class<?> expectedType;
private String expr;
private transient Node node;
- private Class[] paramTypes;
+ private Class<?>[] paramTypes;
/**
*
*/
public MethodExpressionImpl(String expr, Node node,
FunctionMapper fnMapper, VariableMapper varMapper,
- Class expectedType, Class[] paramTypes) {
+ Class<?> expectedType, Class<?>[] paramTypes) {
super();
this.expr = expr;
this.node = node;
public class MethodExpressionLiteral extends MethodExpression implements Externalizable {
- private Class expectedType;
+ private Class<?> expectedType;
private String expr;
- private Class[] paramTypes;
+ private Class<?>[] paramTypes;
public MethodExpressionLiteral() {
// do nothing
}
- public MethodExpressionLiteral(String expr, Class expectedType, Class[] paramTypes) {
+ public MethodExpressionLiteral(String expr, Class<?> expectedType,
+ Class<?>[] paramTypes) {
this.expr = expr;
this.expectedType = expectedType;
this.paramTypes = paramTypes;
public final class ValueExpressionImpl extends ValueExpression implements
Externalizable {
- private Class expectedType;
+ private Class<?> expectedType;
private String expr;
*
*/
public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper,
- VariableMapper varMapper, Class expectedType) {
+ VariableMapper varMapper, Class<?> expectedType) {
this.expr = expr;
this.node = node;
this.fnMapper = fnMapper;
*
* @see javax.el.ValueExpression#getExpectedType()
*/
- public Class getExpectedType() {
+ public Class<?> getExpectedType() {
return this.expectedType;
}
*
* @see javax.el.ValueExpression#getType(javax.el.ELContext)
*/
- public Class getType(ELContext context) throws PropertyNotFoundException,
+ public Class<?> getType(ELContext context) throws PropertyNotFoundException,
ELException {
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
this.varMapper);
private Object value;
- private Class expectedType;
+ private Class<?> expectedType;
public ValueExpressionLiteral() {
super();
}
- public ValueExpressionLiteral(Object value, Class expectedType) {
+ public ValueExpressionLiteral(Object value, Class<?> expectedType) {
this.value = value;
this.expectedType = expectedType;
}
return true;
}
- public Class getType(ELContext context) {
+ public Class<?> getType(ELContext context) {
return (this.value != null) ? this.value.getClass() : null;
}
- public Class getExpectedType() {
+ public Class<?> getExpectedType() {
return this.expectedType;
}
if (ELArithmetic.isNumber(obj)) {
return new Character((char) ((Number) obj).shortValue());
}
- Class objType = obj.getClass();
+ Class<?> objType = obj.getClass();
if (obj instanceof Character) {
return (Character) obj;
}
}
protected final static Number coerceToNumber(final Number number,
- final Class type) throws IllegalArgumentException {
+ final Class<?> type) throws IllegalArgumentException {
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, final Class type)
- throws IllegalArgumentException {
+ public final static Number coerceToNumber(final Object obj,
+ final Class<?> type) throws IllegalArgumentException {
if (obj == null || "".equals(obj)) {
return coerceToNumber(ZERO, type);
}
}
protected final static Number coerceToNumber(final String val,
- final Class type) throws IllegalArgumentException {
+ final Class<?> type) throws IllegalArgumentException {
if (Long.TYPE == type || Long.class.equals(type)) {
return Long.valueOf(val);
}
}
}
- public final static void checkType(final Object obj, final Class type)
+ public final static void checkType(final Object obj, final Class<?> type)
throws IllegalArgumentException {
if (String.class.equals(type)) {
coerceToString(obj);
}
}
- public final static Object coerceToType(final Object obj, final Class type)
- throws IllegalArgumentException {
+ public final static Object coerceToType(final Object obj,
+ final Class<?> type) throws IllegalArgumentException {
if (type == null || Object.class.equals(type) ||
(obj != null && type.isAssignableFrom(obj.getClass()))) {
return obj;
if (numChildren == 1) {
n = n.jjtGetChild(0);
} else {
- Class type = null;
+ Class<?> type = null;
Node child = null;
for (int i = 0; i < numChildren; i++) {
child = n.jjtGetChild(i);
}
}
- public ValueExpression createValueExpression(Class expectedType)
+ public ValueExpression createValueExpression(Class<?> expectedType)
throws ELException {
Node n = this.build();
return new ValueExpressionImpl(this.expression, n, this.fnMapper,
this.varMapper, expectedType);
}
- public MethodExpression createMethodExpression(Class expectedReturnType,
- Class[] expectedParamTypes) throws ELException {
+ public MethodExpression createMethodExpression(Class<?> expectedReturnType,
+ Class<?>[] expectedParamTypes) throws ELException {
Node n = this.build();
if (n instanceof AstValue || n instanceof AstIdentifier) {
return new MethodExpressionImpl(expression, n, this.fnMapper,
public Method getMethod() {
if (this.m == null) {
try {
- Class t = ReflectionUtil.forName(this.owner);
- Class[] p = ReflectionUtil.toTypeArray(this.types);
+ Class<?> t = ReflectionUtil.forName(this.owner);
+ Class<?>[] p = ReflectionUtil.toTypeArray(this.types);
this.m = t.getMethod(this.name, p);
} catch (Exception e) {
e.printStackTrace();
super(i);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Number.class;
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
Object val = this.getValue(ctx);
return (val != null) ? val.getClass() : null;
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return String.class;
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.children[0].getType(ctx);
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.children[0].getType(ctx);
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Boolean.class;
}
return this.getFloatingPoint();
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.getFloatingPoint().getClass();
}
return prefix;
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
this.getOutputName()));
}
- Class[] paramTypes = m.getParameterTypes();
+ Class<?>[] paramTypes = m.getParameterTypes();
Object[] params = null;
Object result = null;
int numParams = this.jjtGetNumChildren();
super(id);
}
- public Class getType(EvaluationContext ctx) throws ELException {
+ public Class<?> getType(EvaluationContext ctx) throws ELException {
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper != null) {
ValueExpression expr = varMapper.resolveVariable(this.image);
ctx.getELResolver().setValue(ctx, null, this.image, value);
}
- private final Object invokeTarget(EvaluationContext ctx, Object target,
- Object[] paramValues) throws ELException {
- if (target instanceof MethodExpression) {
- MethodExpression me = (MethodExpression) target;
- return me.invoke(ctx.getELContext(), paramValues);
- } else if (target == null) {
- throw new MethodNotFoundException("Identity '" + this.image
- + "' was null and was unable to invoke");
- } else {
- throw new ELException(
- "Identity '"
- + this.image
- + "' does not reference a MethodExpression instance, returned type: "
- + target.getClass().getName());
- }
- }
-
public Object invoke(EvaluationContext ctx, Class[] paramTypes,
Object[] paramValues) throws ELException {
return this.getMethodExpression(ctx).invoke(ctx.getELContext(), paramValues);
return number;
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.getInteger().getClass();
}
super(id);
}
- public Class getType(EvaluationContext ctx) throws ELException {
+ public Class<?> getType(EvaluationContext ctx) throws ELException {
return String.class;
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Number.class;
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Boolean.class;
}
super(id);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return null;
}
return this.string;
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return String.class;
}
super(id);
}
- public Class getType(EvaluationContext ctx) throws ELException {
+ public Class<?> getType(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
return ctx.getELResolver().getType(ctx, t.base, t.property);
Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
Object result = null;
try {
- result = m.invoke(t.base, (Object[]) paramValues);
+ result = m.invoke(t.base, paramValues);
} catch (IllegalAccessException iae) {
throw new ELException(iae);
} catch (InvocationTargetException ite) {
public BooleanNode(int i) {
super(i);
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Boolean.class;
}
this.image = image;
}
- public Class getType(EvaluationContext ctx)
+ public Class<?> getType(EvaluationContext ctx)
throws ELException {
throw new UnsupportedOperationException();
}
}
}
- public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException {
+ public Object invoke(EvaluationContext ctx, Class[] paramTypes,
+ Object[] paramValues) throws ELException {
throw new UnsupportedOperationException();
}
- public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException {
+ public MethodInfo getMethodInfo(EvaluationContext ctx,
+ Class[] paramTypes) throws ELException {
throw new UnsupportedOperationException();
}
}
protected static final String[] PRIMITIVE_NAMES = new String[] { "boolean",
"byte", "char", "double", "float", "int", "long", "short", "void" };
- protected static final Class[] PRIMITIVES = new Class[] { boolean.class,
+ protected static final Class<?>[] PRIMITIVES = new Class[] { boolean.class,
byte.class, char.class, double.class, float.class, int.class,
long.class, short.class, Void.TYPE };
super();
}
- public static Class forName(String name) throws ClassNotFoundException {
+ public static Class<?> forName(String name) throws ClassNotFoundException {
if (null == name || "".equals(name)) {
return null;
}
- Class c = forNamePrimitive(name);
+ Class<?> c = forNamePrimitive(name);
if (c == null) {
if (name.endsWith("[]")) {
String nc = name.substring(0, name.length() - 2);
return c;
}
- protected static Class forNamePrimitive(String name) {
+ protected static Class<?> forNamePrimitive(String name) {
if (name.length() <= 8) {
int p = Arrays.binarySearch(PRIMITIVE_NAMES, name);
if (p >= 0) {
* @return
* @throws ClassNotFoundException
*/
- public static Class[] toTypeArray(String[] s) throws ClassNotFoundException {
+ public static Class<?>[] toTypeArray(String[] s) throws ClassNotFoundException {
if (s == null)
return null;
- Class[] c = new Class[s.length];
+ Class<?>[] c = new Class[s.length];
for (int i = 0; i < s.length; i++) {
c[i] = forName(s[i]);
}
* @param c
* @return
*/
- public static String[] toTypeNameArray(Class[] c) {
+ public static String[] toTypeNameArray(Class<?>[] c) {
if (c == null)
return null;
String[] s = new String[c.length];
* @throws MethodNotFoundException
*/
public static Method getMethod(Object base, Object property,
- Class[] paramTypes) throws MethodNotFoundException {
+ Class<?>[] paramTypes) throws MethodNotFoundException {
if (base == null || property == null) {
throw new MethodNotFoundException(MessageFactory.get(
"error.method.notfound", base, property,
return method;
}
- protected static final String paramString(Class[] types) {
+ protected static final String paramString(Class<?>[] types) {
if (types != null) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < types.length; i++) {
public static PropertyDescriptor getPropertyDescriptor(Object base,
Object property) throws ELException, PropertyNotFoundException {
String name = ELSupport.coerceToString(property);
- PropertyDescriptor p = null;
try {
PropertyDescriptor[] desc = Introspector.getBeanInfo(
base.getClass()).getPropertyDescriptors();