/** * If the base object is a Java language array, returns the most general type that this resolver * accepts for the property argument. Otherwise, returns null. Assuming the base is an array, * this method will always return Integer.class. This is because arrays accept integers for * their index. * * @param context * The context of this evaluation. * @param base * The array to analyze. Only bases that are a Java language array are handled by * this resolver. * @return null if base is not a Java language array; otherwise Integer.class. */ @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { return isResolvable(base) ? Integer.class : null; }
if (isResolvable(base)) { int index = toIndex(null, property); result = index < 0 || index >= Array.getLength(base) ? null : Array.get(base, index);
if (isResolvable(base)) { toIndex(base, property); result = base.getClass().getComponentType();
throw new NullPointerException("context is null"); if (isResolvable(base)) { toIndex(base, property); context.setPropertyResolved(true);
throw new NullPointerException("context is null"); if (isResolvable(base)) { if (readOnly) { throw new PropertyNotWritableException("resolver is read-only");