{
plainContent = false;
final String name = atts.getValue(uri, "name");
if (name == null)
{
throw new ParseException("Required attribute 'name' is missing", getLocator());
}
try
{
final Class type = beanUtility.getPropertyType(name);
final Object property = type.newInstance();
final BeanUtility propertyUtility = new BeanUtility(property);
return new TypedPropertyReadHandler
(propertyUtility, expressionName, entityParser);
}
catch (BeanException e)
{
throw new ParseException("Property '" + name + "' for expression '" +
className + "' is not valid. The specified class was not found.",
e, getRootHandler().getDocumentLocator());
}
catch (IllegalAccessException e)
{
throw new ParseException(
"Property '" + name + "' for expression '" + className +
"' is not valid. The specified class was not found.",
e, getRootHandler().getDocumentLocator());
}
catch (InstantiationException e)
{
throw new ParseException(
"Property '" + name + "' for expression '" + className +
"' is not valid. The specified class cannot be instantiated.",
e, getRootHandler().getDocumentLocator());
}
catch (IntrospectionException e)
{
throw new ParseException(
"Property '" + name + "' for expression '" + className +
"' is not valid. Introspection failed for this expression.",
e, getRootHandler().getDocumentLocator());
}
}