public interface CSSParser
| Modifier and Type | Method and Description |
|---|---|
String |
getParserVersion() |
boolean |
isIeStarHackAccepted() |
boolean |
parsePriority(InputSource source)
Parse a CSS priority value (e.g.
|
LexicalUnit |
parsePropertyValue(InputSource source)
Parse a CSS property value.
|
void |
parseRule(InputSource source)
Parse a CSS rule.
|
SelectorList |
parseSelectors(InputSource source)
Parse a comma separated list of selectors.
|
void |
parseStyleDeclaration(InputSource source)
Parse a CSS style declaration (without '{' and '}').
|
void |
parseStyleSheet(InputSource source)
Parse a CSS document.
|
void |
setDocumentHandler(DocumentHandler handler)
Allow an application to register a document event handler.
|
void |
setErrorHandler(CSSErrorHandler handler)
Allow an application to register an error event handler.
|
void |
setIeStarHackAccepted(boolean accepted) |
void setDocumentHandler(DocumentHandler handler)
If the application does not register a document handler, all document events reported by the CSS parser will be silently ignored (this is the default behaviour implemented by HandlerBase).
Applications may register a new or different handler in the middle of a parse, and the CSS parser must begin using the new handler immediately.
handler - The document handler.DocumentHandlervoid setErrorHandler(CSSErrorHandler handler)
If the application does not register an error event handler, all error events reported by the CSS parser will be silently ignored, except for fatalError, which will throw a CSSException (this is the default behaviour implemented by HandlerBase).
Applications may register a new or different handler in the middle of a parse, and the CSS parser must begin using the new handler immediately.
handler - The error handler.CSSErrorHandler,
CSSExceptionvoid parseStyleSheet(InputSource source) throws CSSException, IOException
The application can use this method to instruct the CSS parser to begin parsing an CSS document from any valid input source (a character stream, a byte stream, or a URI).
Applications may not invoke this method while a parse is in progress (they should create a new Parser instead for each additional CSS document). Once a parse is complete, an application may reuse the same Parser object, possibly with a different input source.
source - The input source for the top-level of the
CSS document.CSSException - Any CSS exception, possibly
wrapping another exception.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.InputSource,
setDocumentHandler(com.gargoylesoftware.css.parser.DocumentHandler),
setErrorHandler(com.gargoylesoftware.css.parser.CSSErrorHandler)void parseStyleDeclaration(InputSource source) throws CSSException, IOException
source - source to be parsedCSSException - Any CSS exception, possibly
wrapping another exception.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.void parseRule(InputSource source) throws CSSException, IOException
source - source to be parsedCSSException - Any CSS exception, possibly
wrapping another exception.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.String getParserVersion()
SelectorList parseSelectors(InputSource source) throws CSSException, IOException
source - source to be parsedCSSException - Any CSS exception, possibly
wrapping another exception.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.LexicalUnit parsePropertyValue(InputSource source) throws CSSException, IOException
source - source to be parsedCSSException - Any CSS exception, possibly
wrapping another exception.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.boolean parsePriority(InputSource source) throws CSSException, IOException
source - source to be parsedCSSException - Any CSS exception, possibly
wrapping another exception.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.void setIeStarHackAccepted(boolean accepted)
accepted - trur if the parser should accept ie star hackboolean isIeStarHackAccepted()
Copyright © 2020. All rights reserved.