@Override
public void setValue(Object base, int index, Object newValue) throws EvaluationException, PropertyNotFoundException
{
if (base == null)
{
throw new PropertyNotFoundException();
}
Class baseType = base.getClass();
if (base instanceof Object[])
{
if (index < 0 || index >= ((Object[])base).length)
{
throw new PropertyNotFoundException();
}
setValue(base, Integer.valueOf(index), newValue);
}
else if (base instanceof List)
{
if (index < 0 || index >= ((List<?>)base).size())
{
throw new PropertyNotFoundException();
}
setValue(base, Integer.valueOf(index), newValue);
}
else if (baseType.isArray())
{
if (index < 0 || index >= Array.getLength(base))
{
throw new PropertyNotFoundException();
}
Array.set(base, index, getFacesContext().getApplication().
getExpressionFactory().coerceToType(newValue, baseType.getComponentType()));
}
else