{
final BeanUtility utility = new BeanUtility(expression);
final ExpressionPropertyMetaData[] propertyDescriptions = expressionMetaData.getPropertyDescriptions();
for (int x = 0; x < propertyDescriptions.length; x++)
{
final ExpressionPropertyMetaData metaData = propertyDescriptions[x];
final Object o = utility.getProperty(metaData.getName());
final String[] referencedFields = metaData.getReferencedFields(expression, o);
for (int y = 0; y < referencedFields.length; y++)
{
final String field = referencedFields[y];
if (isValidField(field, columnNames) == false)
{
final AttributeMetaData attrMetaData =
element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
if (attrMetaData == null)
{
resultHandler.notifyInspectionResult(new InspectionResult(this, Severity.WARNING,
Messages.getString("InvalidFieldReferenceInspection.AttributeExpressionInvalidFieldNoMetaData",
element.getName(), attributeNamespace, attributeName, field, metaData.getDisplayName(Locale.getDefault())),
new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())
));
}
else
{
resultHandler.notifyInspectionResult(new InspectionResult(this, Severity.WARNING,
Messages.getString("InvalidFieldReferenceInspection.AttributeExpressionInvalidField",
element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), field, metaData.getDisplayName(Locale.getDefault())),
new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())
));
}
}
}
}