}
@Override
public void submitValue(final String expression, final Object value)
{
Expressions expressions = expressionsInstance.get();
String el = groomExpression(expression);
if (getExpectedType(expressions.getELContext(), expressions.getExpressionFactory(), el).isArray())
{
Object[] toInject = null;
if ((value != null) && !value.getClass().isArray())
{
toInject = new Object[] { value };
}
else
toInject = (Object[]) value;
setValue(expressions.getELContext(), expressions.getExpressionFactory(), el, toInject);
}
else
{
Object toInject = value;
if ((value != null) && value.getClass().isArray())
{
Object[] array = (Object[]) value;
if (array.length > 0)
{
toInject = array[0];
}
else
{
toInject = "";
}
}
setValue(expressions.getELContext(), expressions.getExpressionFactory(), el, toInject);
}
}