|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.servlet.util.HTMLUtil
public class HTMLUtil
HTML related utility functions.
| Field Summary | |
|---|---|
protected static Pattern |
_url
|
| Constructor Summary | |
|---|---|
HTMLUtil()
|
|
| Method Summary | |
|---|---|
static String |
entify(String text)
Converts instances of <, >, & and " into their
entified equivalents: <, >, & and ". |
static String |
makeLinear(String text)
Inserts a <br> tag before every newline. |
static String |
makeParagraphs(String text)
Inserts a <p> tag between every two consecutive newlines. |
static String |
restrictHTML(String src)
Restrict all HTML from the specified String. |
static String |
restrictHTML(String src,
boolean allowFormatting,
boolean allowImages,
boolean allowLinks)
Restrict HTML except for the specified tags. |
static String |
restrictHTML(String src,
String[] regexes)
Restrict HTML from the specified string except for the specified regular expressions. |
static String |
simpleFormat(String text)
Does some simple HTML markup, matching bare image URLs and wrapping them in image tags, matching other URLs and wrapping them in href tags, and wrapping * prefixed lists into ul-style HTML lists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Pattern _url
| Constructor Detail |
|---|
public HTMLUtil()
| Method Detail |
|---|
public static String entify(String text)
<, >, & and " into their
entified equivalents: <, >, & and ".
These characters are mentioned in the HTML spec as being common
candidates for entification.
public static String makeParagraphs(String text)
public static String makeLinear(String text)
public static String simpleFormat(String text)
public static String restrictHTML(String src)
public static String restrictHTML(String src,
boolean allowFormatting,
boolean allowImages,
boolean allowLinks)
allowFormatting - enables <i>, <b>, <u>,
<font>, <br>, <p>, and
<hr>.allowImages - enabled <img ...>.allowLinks - enabled <a href ...>.
public static String restrictHTML(String src,
String[] regexes)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||