|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.servlet.HtmlEncoder
public class HtmlEncoder
Encodes text and URL strings in various ways resulting HTML-safe text.
All methods are null safe.
| Field Summary | |
|---|---|
protected static char[][] |
BLOCK
|
protected static char[][] |
TEXT
|
| Constructor Summary | |
|---|---|
HtmlEncoder()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
block(java.lang.String text)
Encodes text into HTML-safe block preserving paragraphs. |
static java.lang.String |
strict(java.lang.String text)
Encodes text int HTML-safe block and preserves format using smart spaces. |
static java.lang.String |
text(java.lang.String text)
Encodes a string to HTML-safe text. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final char[][] TEXT
protected static final char[][] BLOCK
| Constructor Detail |
|---|
public HtmlEncoder()
| Method Detail |
|---|
public static java.lang.String text(java.lang.String text)
block(String)public static java.lang.String block(java.lang.String text)
default
special characters the following are replaced, too:
Method accepts any of CR, LF, or CR+LF as a line terminator.
public static java.lang.String strict(java.lang.String text)
block(String), the following characters are replaced:
This method preserves the format as much as possible, using the combination of not-breakable and common spaces.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||