|
code.google.com home | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface HtmlSanitizer.Policy
Receives events based on the HTML stream, and applies a policy to decide
what HTML constructs to allow.
Typically, implementations use an HtmlStreamRenderer
to produce
the sanitized output.
Implementations of this class are in the TCB.
Method Summary | |
---|---|
void |
closeTag(java.lang.String elementName)
Called when an HTML tag like </foo> is seen in the input. |
void |
openTag(java.lang.String elementName,
java.util.List<java.lang.String> attrs)
Called when an HTML tag like <foo bar=baz> is seen in the input. |
void |
text(java.lang.String textChunk)
Called when textual content is seen. |
Methods inherited from interface org.owasp.html.HtmlStreamEventReceiver |
---|
closeDocument, openDocument |
Method Detail |
---|
void openTag(java.lang.String elementName, java.util.List<java.lang.String> attrs)
<foo bar=baz>
is seen in the input.
openTag
in interface HtmlStreamEventReceiver
elementName
- a normalized (lower-case for non-namespaced names)
element name.attrs
- a list of alternating attribute name and value pairs.
For efficiency, this list may be mutated by this during this method
call, but ownership reverts to the caller on method exit.
The values are raw -- HTML entities have been decoded.
Specifically, implementations are allowed to use a list iterator
and remove all disallowed attributes, add necessary attributes, and
then pass the list to an HtmlStreamRenderer
.void closeTag(java.lang.String elementName)
</foo>
is seen in the input.
closeTag
in interface HtmlStreamEventReceiver
elementName
- a normalized (lower-case for non-namespaced names)
element name.void text(java.lang.String textChunk)
text
in interface HtmlStreamEventReceiver
textChunk
- raw content -- HTML entities have been decoded.
|
code.google.com home | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |