|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.owasp.validator.css.CssHandler
public class CssHandler
A implementation of a SAC DocumentHandler for CSS validation. The appropriate validation method is called whenever the handler is invoked by the parser. The handler also builds a clean CSS document as the original CSS is scanned. NOTE: keeping state in this class is not ideal as handler style parsing a la SAX should generally be event driven. However, there is not a fully implemented "DOM" equivalent to CSS at this time. Java has a StyleSheet class that could accomplish this "DOM" like behavior but it has yet to be fully implemented
StyleSheet| Constructor Summary | |
|---|---|
CssHandler(Policy policy,
LinkedList embeddedStyleSheets)
Constructs a handler for stylesheets using the given policy and queue for imported stylesheets. |
|
CssHandler(Policy policy,
LinkedList embeddedStyleSheets,
String tagName)
Constructs a handler for inline style declarations using the given policy and queue for imported stylesheets. |
|
| Method Summary | |
|---|---|
void |
comment(String text)
|
void |
endDocument(InputSource source)
|
void |
endFontFace()
|
void |
endMedia(SACMediaList media)
|
void |
endPage(String name,
String pseudoPage)
|
void |
endSelector(SelectorList selectors)
|
CleanResults |
getResults()
Returns the encapsulated results generated by the handler during parsing. |
void |
ignorableAtRule(String atRule)
|
void |
importStyle(String uri,
SACMediaList media,
String defaultNamespaceURI)
|
void |
namespaceDeclaration(String prefix,
String uri)
|
void |
property(String name,
LexicalUnit value,
boolean important)
|
void |
startDocument(InputSource arg0)
|
void |
startFontFace()
|
void |
startMedia(SACMediaList media)
|
void |
startPage(String name,
String pseudoPage)
|
void |
startSelector(SelectorList selectors)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CssHandler(Policy policy,
LinkedList embeddedStyleSheets)
policy - the policy to useembeddedStyleSheets - the queue of stylesheets imported
public CssHandler(Policy policy,
LinkedList embeddedStyleSheets,
String tagName)
policy - the policy to useembeddedStyleSheets - the queue of stylesheets importedtagName - the associated tag name with this inline style| Method Detail |
|---|
public CleanResults getResults()
CleanResults object containing the results
generated by the handler
public void comment(String text)
throws CSSException
comment in interface DocumentHandlerCSSException
public void ignorableAtRule(String atRule)
throws CSSException
ignorableAtRule in interface DocumentHandlerCSSException
public void importStyle(String uri,
SACMediaList media,
String defaultNamespaceURI)
throws CSSException
importStyle in interface DocumentHandlerCSSException
public void namespaceDeclaration(String prefix,
String uri)
throws CSSException
namespaceDeclaration in interface DocumentHandlerCSSException
public void startDocument(InputSource arg0)
throws CSSException
startDocument in interface DocumentHandlerCSSException
public void endDocument(InputSource source)
throws CSSException
endDocument in interface DocumentHandlerCSSException
public void startFontFace()
throws CSSException
startFontFace in interface DocumentHandlerCSSException
public void endFontFace()
throws CSSException
endFontFace in interface DocumentHandlerCSSException
public void startMedia(SACMediaList media)
throws CSSException
startMedia in interface DocumentHandlerCSSException
public void endMedia(SACMediaList media)
throws CSSException
endMedia in interface DocumentHandlerCSSException
public void startPage(String name,
String pseudoPage)
throws CSSException
startPage in interface DocumentHandlerCSSException
public void endPage(String name,
String pseudoPage)
throws CSSException
endPage in interface DocumentHandlerCSSException
public void startSelector(SelectorList selectors)
throws CSSException
startSelector in interface DocumentHandlerCSSException
public void endSelector(SelectorList selectors)
throws CSSException
endSelector in interface DocumentHandlerCSSException
public void property(String name,
LexicalUnit value,
boolean important)
throws CSSException
property in interface DocumentHandlerCSSException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||