protected void visit(RENode.CharacterClassExpr.Char expr) throws IOException { Literal.escapeTo(expr.getValue(), appendable); } }
public static void escapeTo(char value, Appendable appendable) throws IOException, NullPointerException { if (appendable == null) { throw new NullPointerException(); } if (isEscaped(value)) { appendable.append('\\'); } appendable.append(value); } }
protected void visit(RENode.CharacterClassExpr.Char expr) throws IOException { Literal.escapeTo(expr.getValue(), appendable); } }
public static void escapeTo(char value, Appendable appendable) throws IOException, NullPointerException { if (appendable == null) { throw new NullPointerException(); } if (isEscaped(value)) { appendable.append('\\'); } appendable.append(value); } }
protected void visit(RENode.Char expr) throws IOException { Literal.escapeTo(expr.getValue(), appendable); if (expr.getQuantifier() != null) { expr.getQuantifier().toString(appendable); } }
public PatternBuilder litteral(CharSequence s, int from, int to) { if (from < 0) { throw new IllegalArgumentException("No negative from argument"); } if (to > s.length()) { throw new IllegalArgumentException("No to argument greater than the string length"); } if (from > to) { throw new IllegalArgumentException("The to argument cannot be greater than the from argument"); } if (from < to) { for (int i = from;i < to;i++) { char c = s.charAt(i); if (Literal.isEscaped(c)) { buffer.append('\\'); } buffer.append(c); } } return this; }
protected void visit(RENode.Char expr) throws IOException { Literal.escapeTo(expr.getValue(), appendable); if (expr.getQuantifier() != null) { expr.getQuantifier().toString(appendable); } }
public PatternBuilder litteral(CharSequence s, int from, int to) { if (from < 0) { throw new IllegalArgumentException("No negative from argument"); } if (to > s.length()) { throw new IllegalArgumentException("No to argument greater than the string length"); } if (from > to) { throw new IllegalArgumentException("The to argument cannot be greater than the from argument"); } if (from < to) { for (int i = from;i < to;i++) { char c = s.charAt(i); if (Literal.isEscaped(c)) { buffer.append('\\'); } buffer.append(c); } } return this; }