if (attributeMetaData == null)
{
resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
Messages.getString("ExpressionsParameterInspection.AttributeExpressionMandatoryPropertyMissingNoMetaData",
element.getName(), attributeNamespace, attributeName, metaData.getDisplayName(Locale.getDefault())),
new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
}
else
{
resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
Messages.getString("ExpressionsParameterInspection.AttributeExpressionMandatoryPropertyMissing",
element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()),
metaData.getDisplayName(Locale.getDefault())),
new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
}
}
}
if (expression instanceof ValidateableExpression)
{
final ValidateableExpression vae = (ValidateableExpression) expression;
final Map map = vae.validateParameter(new ReportDesignerDesignTimeContext(designerContext), Locale.getDefault());
final Iterator iterator = map.entrySet().iterator();
while (iterator.hasNext())
{
final Map.Entry entry = (Map.Entry) iterator.next();
final String property = (String) entry.getKey();
final String warning = (String) entry.getValue();
final AttributeMetaData attributeMetaData =
element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
if (attributeMetaData == null)
{
if (property == null)
{
resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationErrorNoMetaData",
element.getName(), attributeNamespace, attributeName, warning),
new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
}
else
{
resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationPropertyErrorNoMetaData",
element.getName(), attributeNamespace, attributeName, property, warning),
new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, property)));
}
}
else
{
if (property == null)
{
resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationError",
element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()), warning),
new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
}
else
{
resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationPropertyError",
element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()), property, warning),
new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, property)));
}
}
}
}
}