MCPcopy Create free account
hub / github.com/antlr/codebuff / addEscape

Method addEscape

corpus/java/training/guava/escape/Escapers.java:143–149  ·  view source on GitHub ↗

Adds a replacement string for the given input character. The specified character will be replaced by the given string whenever it occurs in the input, irrespective of whether it lies inside or outside the 'safe' range. @param c the character to be replaced @param replacement the string to replace t

(char c, String replacement)

Source from the content-addressed store, hash-verified

141 * @throws NullPointerException if {@code replacement} is null
142 */
143 @CanIgnoreReturnValue
144 public Builder addEscape(char c, String replacement) {
145 checkNotNull(replacement);
146 // This can replace an existing character (the builder is re-usable).
147 replacementMap.put(c, replacement);
148 return this;
149 }
150
151 /**
152 * Returns a new escaper based on the current state of the builder.

Callers 2

HtmlEscapersClass · 0.45
XmlEscapersClass · 0.45

Calls 2

putMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected