use of org.jboss.el.lang.ExpressionBuilder in project sonar-web by SonarSource.
the class UnifiedExpressionCheck method validateExpression.
private void validateExpression(TagNode element, Attribute attribute) {
ExpressionLanguageContext context = new ExpressionLanguageContext(element);
ExpressionBuilder builder = new ExpressionBuilder(attribute.getValue(), context);
try {
builder.createValueExpression(Object.class);
} catch (ELException e) {
if (e.getMessage().startsWith("Error")) {
createViolation(element.getStartLinePosition(), "Fix this expression: " + (e.getMessage() == null ? "" : e.getMessage()));
}
}
}
use of org.jboss.el.lang.ExpressionBuilder in project sonar-web by SonarSource.
the class UnifiedExpressionCheck method validateExpression.
private void validateExpression(TagNode element, Attribute attribute) {
ExpressionLanguageContext context = new ExpressionLanguageContext(element);
ExpressionBuilder builder = new ExpressionBuilder(attribute.getValue(), context);
try {
builder.createValueExpression(Object.class);
} catch (ELException e) {
if (e.getMessage().startsWith("Error")) {
createViolation(element.getStartLinePosition(), "Fix this expression: " + (e.getMessage() == null ? "" : e.getMessage()));
}
}
}
Aggregations