@Test public void testVisitNode() { visitor.visit(new Condition.Node(SERACH_EXPR)); String s = statement.toString(); assertFalse(s.contains(SERACH_EXPR)); assertTrue(s.contains(QueryUtils.escapeForQuery(SERACH_EXPR))); assertTrue(s.contains(QueryUtils.escapeForQuery(QueryUtils.escapeNodeName(SERACH_EXPR)))); }
@Override public void visit(@NotNull Condition.Node condition) { statement.append('(') .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_AUTHORIZABLE_ID, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_PRINCIPAL_NAME, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(fn:name(),'") .append(QueryUtil.escapeForQuery(QueryUtil.escapeNodeName(condition.getPattern()))) .append("')") .append(')'); }
XPathConditionVisitor implements ConditionVisitor { @Override public void visit(@NotNull Condition.Node condition) { statement.append('(') .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_AUTHORIZABLE_ID, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_PRINCIPAL_NAME, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(fn:name(),'") .append(QueryUtil.escapeForQuery(QueryUtil.escapeNodeName(condition.getPattern()))) .append("')") .append(')'); } }
XPathConditionVisitor implements ConditionVisitor { @Override public void visit(@NotNull Condition.Node condition) { statement.append('(') .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_AUTHORIZABLE_ID, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_PRINCIPAL_NAME, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(fn:name(),'") .append(QueryUtil.escapeForQuery(QueryUtil.escapeNodeName(condition.getPattern()))) .append("')") .append(')'); } XPathConditionVisitor(@NotNull StringBuilder statement, @NotNull NamePathMapper namePathMapper,
                          @NotNull UserManager userMgr); }
XPathConditionVisitor implements ConditionVisitor { @Override public void visit(@NotNull Condition.Node condition) { statement.append('(') .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_AUTHORIZABLE_ID, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_PRINCIPAL_NAME, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(fn:name(),'") .append(QueryUtil.escapeForQuery(QueryUtil.escapeNodeName(condition.getPattern()))) .append("')") .append(')'); } XPathConditionVisitor(@NotNull StringBuilder statement, @NotNull NamePathMapper namePathMapper,
                          @NotNull UserManager userMgr); @Override void visit(@NotNull Condition.Node condition); @Override void visit(@NotNull Condition.PropertyValue condition); @Override void visit(Condition.@NotNull PropertyLike condition); @Override void visit(Condition.@NotNull PropertyExists condition); @Override void visit(@NotNull Condition.Contains condition); @Override void visit(@NotNull Condition.Impersonation condition); @Override void visit(@NotNull Condition.Not condition); @Override void visit(@NotNull Condition.And condition); @Override void visit(@NotNull Condition.Or condition); }
XPathConditionVisitor implements ConditionVisitor { @Override public void visit(@NotNull Condition.Node condition) { statement.append('(') .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_AUTHORIZABLE_ID, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(@") .append(QueryUtil.escapeForQuery(UserConstants.REP_PRINCIPAL_NAME, namePathMapper)) .append(",'") .append(QueryUtil.escapeForQuery(condition.getPattern())) .append("')") .append(" or ") .append("jcr:like(fn:name(),'") .append(QueryUtil.escapeForQuery(QueryUtil.escapeNodeName(condition.getPattern()))) .append("')") .append(')'); } XPathConditionVisitor(@NotNull StringBuilder statement, @NotNull NamePathMapper namePathMapper,
                          @NotNull UserManager userMgr); @Override void visit(@NotNull Condition.Node condition); @Override void visit(@NotNull Condition.PropertyValue condition); @Override void visit(Condition.@NotNull PropertyLike condition); @Override void visit(Condition.@NotNull PropertyExists condition); @Override void visit(@NotNull Condition.Contains condition); @Override void visit(@NotNull Condition.Impersonation condition); @Override void visit(@NotNull Condition.Not condition); @Override void visit(@NotNull Condition.And condition); @Override void visit(@NotNull Condition.Or condition);  }