use of io.jans.scim.service.antlr.scimFilter.util.SimpleExpression in project jans by JanssenProject.
the class MatchFilterVisitor method visitAttrexp.
@Override
public Boolean visitAttrexp(ScimFilterParser.AttrexpContext ctx) {
log.trace("visitAttrexp. childs: {}, text: {}", ctx.getChildCount(), ctx.getText());
String path = ctx.attrpath().getText();
ScimFilterParser.CompvalueContext compValueCtx = ctx.compvalue();
boolean isPrRule = compValueCtx == null && ctx.getChild(1).getText().equals("pr");
ScimOperator operator;
CompValueType valueType;
String value;
if (isPrRule) {
operator = ScimOperator.NOT_EQUAL;
valueType = CompValueType.NULL;
value = null;
} else {
operator = ScimOperator.getByValue(ctx.compareop().getText());
valueType = FilterUtil.getCompValueType(compValueCtx);
value = compValueCtx.getText();
if (// drop double quotes
CompValueType.STRING.equals(valueType))
value = value.substring(1, value.length() - 1);
}
SimpleExpression expr = new SimpleExpression(path, operator, valueType, value);
expr.setParentAttribute(parentAttribute);
expr.setResourceClass(resourceClass);
return expr.evaluate(item);
}
Aggregations