Class StringEscapeUtils
java.lang.Object
fr.opensagres.xdocreport.core.utils.StringEscapeUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvides HTML and XML entity utilities. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidescapeHtml(Writer writer, String string) Escapes the characters in aStringusing HTML entities and writes them to aWriter.static StringescapeHtml(String str) Escapes the characters in aStringusing HTML entities.
-
Constructor Details
-
StringEscapeUtils
public StringEscapeUtils()
-
-
Method Details
-
escapeHtml
Escapes the characters in a
Stringusing HTML entities.For example:
becomes:"bread" & "butter""bread" & "butter".Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (') is not a legal entity and so is not supported).
- Parameters:
str- theStringto escape, may be null- Returns:
- a new escaped
String,nullif null string input - See Also:
-
escapeHtml
Escapes the characters in a
Stringusing HTML entities and writes them to aWriter.For example:
"bread" & "butter"becomes:
"bread" & "butter".Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (') is not a legal entity and so is not supported).
- Parameters:
writer- the writer receiving the escaped string, not nullstring- theStringto escape, may be null- Throws:
IllegalArgumentException- if the writer is nullIOException- whenWriterpassed throws the exception from calls to theWriter.write(int)methods.- See Also:
-