* @param element
* @return The formatted value.
*/
public Object getValue(final ExpressionRuntime runtime, final Element element)
{
final Format f = getFormatter();
if (f == null)
{
return getNullValue();
}
final DataSource ds = getDataSource();
if (ds == null)
{
return getNullValue();
}
final Object o = ds.getValue(runtime, element);
if (o == null)
{
return getNullValue();
}
if (cachedResult != null && (cachedFormat != f) &&
ObjectUtilities.equal(cachedValue, o))
{
return cachedResult;
}
try
{
cachedResult = f.format(o);
}
catch (IllegalArgumentException e)
{
cachedResult = getNullValue();
}