Class ExprTextUtils

java.lang.Object
org.eclipse.rdf4j.queryrender.sparql.util.ExprTextUtils

public final class ExprTextUtils extends Object
Helpers for adding/removing parentheses around expression text.
  • Method Details

    • stripRedundantOuterParens

      public static String stripRedundantOuterParens(String s)
    • parenthesizeIfNeededSimple

      public static String parenthesizeIfNeededSimple(String s)
      Simple parentheses wrapper used in a few contexts (e.g., HAVING NOT): if the string is non-empty and does not start with '(', wrap it.
    • parenthesizeIfNeededExpr

      public static String parenthesizeIfNeededExpr(String expr)
      Parenthesize an expression only if the current string is not already wrapped by a single outer pair.