|
||||||||||
| 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.
javax.swing.text.html.StyleSheet| Constructor Summary | |
|---|---|
CssHandler(Policy policy,
java.util.LinkedList embeddedStyleSheets,
java.util.ArrayList errorMessages,
java.util.ResourceBundle messages)
Constructs a handler for stylesheets using the given policy and queue for imported stylesheets. |
|
CssHandler(Policy policy,
java.util.LinkedList embeddedStyleSheets,
java.util.ArrayList errorMessages,
java.lang.String tagName,
java.util.ResourceBundle messages)
Constructs a handler for inline style declarations using the given policy and queue for imported stylesheets. |
|
| Method Summary | |
|---|---|
void |
comment(java.lang.String text)
|
void |
endDocument(org.w3c.css.sac.InputSource source)
|
void |
endFontFace()
|
void |
endMedia(org.w3c.css.sac.SACMediaList media)
|
void |
endPage(java.lang.String name,
java.lang.String pseudoPage)
|
void |
endSelector(org.w3c.css.sac.SelectorList selectors)
|
java.lang.String |
getCleanStylesheet()
Returns the cleaned stylesheet. |
java.util.Collection |
getErrorMessages()
Returns the error messages generated during parsing. |
void |
ignorableAtRule(java.lang.String atRule)
|
void |
importStyle(java.lang.String uri,
org.w3c.css.sac.SACMediaList media,
java.lang.String defaultNamespaceURI)
|
void |
namespaceDeclaration(java.lang.String prefix,
java.lang.String uri)
|
void |
property(java.lang.String name,
org.w3c.css.sac.LexicalUnit value,
boolean important)
|
void |
startDocument(org.w3c.css.sac.InputSource arg0)
|
void |
startFontFace()
|
void |
startMedia(org.w3c.css.sac.SACMediaList media)
|
void |
startPage(java.lang.String name,
java.lang.String pseudoPage)
|
void |
startSelector(org.w3c.css.sac.SelectorList selectors)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CssHandler(Policy policy,
java.util.LinkedList embeddedStyleSheets,
java.util.ArrayList errorMessages,
java.util.ResourceBundle messages)
policy - the policy to useembeddedStyleSheets - the queue of stylesheets imported
public CssHandler(Policy policy,
java.util.LinkedList embeddedStyleSheets,
java.util.ArrayList errorMessages,
java.lang.String tagName,
java.util.ResourceBundle messages)
policy - the policy to useembeddedStyleSheets - the queue of stylesheets importedtagName - the associated tag name with this inline style| Method Detail |
|---|
public java.lang.String getCleanStylesheet()
public java.util.Collection getErrorMessages()
public void comment(java.lang.String text)
throws org.w3c.css.sac.CSSException
comment in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void ignorableAtRule(java.lang.String atRule)
throws org.w3c.css.sac.CSSException
ignorableAtRule in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void importStyle(java.lang.String uri,
org.w3c.css.sac.SACMediaList media,
java.lang.String defaultNamespaceURI)
throws org.w3c.css.sac.CSSException
importStyle in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void namespaceDeclaration(java.lang.String prefix,
java.lang.String uri)
throws org.w3c.css.sac.CSSException
namespaceDeclaration in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void startDocument(org.w3c.css.sac.InputSource arg0)
throws org.w3c.css.sac.CSSException
startDocument in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void endDocument(org.w3c.css.sac.InputSource source)
throws org.w3c.css.sac.CSSException
endDocument in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void startFontFace()
throws org.w3c.css.sac.CSSException
startFontFace in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void endFontFace()
throws org.w3c.css.sac.CSSException
endFontFace in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void startMedia(org.w3c.css.sac.SACMediaList media)
throws org.w3c.css.sac.CSSException
startMedia in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void endMedia(org.w3c.css.sac.SACMediaList media)
throws org.w3c.css.sac.CSSException
endMedia in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void startPage(java.lang.String name,
java.lang.String pseudoPage)
throws org.w3c.css.sac.CSSException
startPage in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void endPage(java.lang.String name,
java.lang.String pseudoPage)
throws org.w3c.css.sac.CSSException
endPage in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void startSelector(org.w3c.css.sac.SelectorList selectors)
throws org.w3c.css.sac.CSSException
startSelector in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void endSelector(org.w3c.css.sac.SelectorList selectors)
throws org.w3c.css.sac.CSSException
endSelector in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
public void property(java.lang.String name,
org.w3c.css.sac.LexicalUnit value,
boolean important)
throws org.w3c.css.sac.CSSException
property in interface org.w3c.css.sac.DocumentHandlerorg.w3c.css.sac.CSSException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||