else
{
className = getDefaultClassName();
if (className == null)
{
throw new ParseException("Required attribute 'class' is missing.",
getRootHandler().getDocumentLocator());
}
}
}
if (expression == null)
{
expression = (Expression) ObjectUtilities.loadAndInstantiate
(className, AbstractExpressionReadHandler.class, Expression.class);
if (expression == null)
{
throw new ParseException("Expression '" + className +
"' is not valid. The specified class is not an expression or function.",
getRootHandler().getDocumentLocator());
}
}
expression.setName(name);
expression.setDeepTraversing("true".equals(attrs.getValue(getUri(), "deep-traversing")));
expression.setPrecompute("true".equals(attrs.getValue(getUri(), "precompute")));
expression.setPreserve("true".equals(attrs.getValue(getUri(), "preserve")));
try
{
expressionBeanUtility = new BeanUtility(expression);
}
catch (ClassCastException e)
{
throw new ParseException("Expression '" + className +
"' is not valid. The specified class is not an expression or function.",
e, getRootHandler().getDocumentLocator());
}
catch (IntrospectionException e)
{
throw new ParseException("Expression '" + className +
"' is not valid. Introspection failed for this expression.",
e, getRootHandler().getDocumentLocator());
}
}