|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.text.html.parser.Parser | +--org.quasiliteral.html.SafeHTMLParser
Untamed: Parses html and throws an exception if the html contains any unsafe tags.
JEditorPane#setText(String)
Field Summary | |
private String |
myText
|
static ConstMap |
SafeTagMap
Enabled: |
private static String[][] |
SafeTags
Each row is a safe tag followed by its allowed safe attributes. |
Fields inherited from class javax.swing.text.html.parser.Parser |
dtd, strict |
Fields inherited from interface javax.swing.text.html.parser.DTDConstants |
ANY, CDATA, CONREF, CURRENT, DEFAULT, EMPTY, ENDTAG, ENTITIES, ENTITY, FIXED, GENERAL, ID, IDREF, IDREFS, IMPLIED, MD, MODEL, MS, NAME, NAMES, NMTOKEN, NMTOKENS, NOTATION, NUMBER, NUMBERS, NUTOKEN, NUTOKENS, PARAMETER, PI, PUBLIC, RCDATA, REQUIRED, SDATA, STARTTAG, SYSTEM |
Constructor Summary | |
private |
SafeHTMLParser(DTD dtd,
String text)
|
Method Summary | |
protected void |
handleEmptyTag(TagElement tag)
Called when an empty tag is encountered. |
protected void |
handleError(int ln,
String msg)
An error has occurred. |
protected void |
handleStartTag(TagElement tag)
Called when a start tag is encountered. |
private static SafeHTMLParser |
make(String text)
|
static void |
parseText(String text)
Enabled: |
Methods inherited from class javax.swing.text.html.parser.Parser |
endTag, error, error, error, error, flushAttributes, getAttributes, getCurrentLine, getCurrentPos, handleComment, handleEndTag, handleEOFInComment, handleText, handleTitle, makeTag, makeTag, markFirstTime, parse, parseDTDMarkup, parseMarkupDeclarations, startTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String[][] SafeTags
This list is expected to grow over time.
public static final ConstMap SafeTagMap
private final String myText
Constructor Detail |
private SafeHTMLParser(DTD dtd, String text)
Method Detail |
private static SafeHTMLParser make(String text)
public static void parseText(String text)
protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException
handleEmptyTag
in class Parser
ChangedCharSetException
protected void handleStartTag(TagElement tag)
handleStartTag
in class Parser
protected void handleError(int ln, String msg)
handleError
in class Parser
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |