public class HtmlEncoder
extends java.lang.Object
null safe.| Modifier and Type | Field and Description |
|---|---|
protected static char[][] |
ATTR |
protected static char[][] |
BLOCK |
protected static char[][] |
TEXT |
| Constructor and Description |
|---|
HtmlEncoder() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
attribute(java.lang.String value)
Encodes HTML attribute value string to safe text.
|
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.
|
protected static final char[][] ATTR
protected static final char[][] TEXT
protected static final char[][] BLOCK
public static java.lang.String attribute(java.lang.String value)
text(String),
block(String)public static java.lang.String text(java.lang.String text)
attribute(String),
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.
Copyright © 2003-2013 Jodd Team