| Constructor and Description |
|---|
AbstractCSSParser() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
add_escapes(String str) |
protected Locator |
createLocator(com.gargoylesoftware.css.parser.javacc.Token t) |
protected CSSParseException |
createSkipWarning(String key,
CSSParseException e) |
protected abstract LexicalUnit |
expr() |
protected float |
floatValue(char op,
String s) |
protected LexicalUnit |
functionInternal(LexicalUnit prev,
String funct,
LexicalUnit params) |
protected DocumentHandler |
getDocumentHandler() |
protected CSSErrorHandler |
getErrorHandler() |
protected abstract String |
getGrammarUri() |
protected InputSource |
getInputSource() |
protected int |
getLastNumPos(String s) |
protected String |
getParserMessage(String key) |
abstract String |
getParserVersion() |
protected void |
handleCharset(String characterEncoding,
Locator locator) |
protected void |
handleEndDocument() |
protected void |
handleEndFontFace() |
protected void |
handleEndMedia(MediaQueryList media) |
protected void |
handleEndPage(String name,
String pseudoPage) |
protected void |
handleEndSelector(SelectorList selectors) |
protected void |
handleIgnorableAtRule(String s,
Locator locator) |
protected void |
handleImportStyle(String uri,
MediaQueryList media,
String defaultNamespaceURI,
Locator locator) |
protected void |
handleMedium(String medium,
Locator locator) |
protected void |
handleProperty(String name,
LexicalUnit value,
boolean important,
Locator locator) |
protected void |
handleSelector(Selector selector) |
protected void |
handleStartDocument() |
protected void |
handleStartFontFace(Locator locator) |
protected void |
handleStartMedia(MediaQueryList media,
Locator locator) |
protected void |
handleStartPage(String name,
String pseudoPage,
Locator locator) |
protected void |
handleStartSelector(SelectorList selectors,
Locator locator) |
protected LexicalUnit |
hexcolorInternal(LexicalUnit prev,
com.gargoylesoftware.css.parser.javacc.Token t) |
protected int |
intValue(char op,
String s) |
boolean |
isIeStarHackAccepted() |
protected abstract void |
mediaList(MediaQueryList ml) |
MediaQueryList |
parseMedia(InputSource source) |
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.
|
protected abstract SelectorList |
parseSelectorsInternal() |
void |
parseStyleDeclaration(InputSource source)
Parse a CSS style declaration (without '{' and '}').
|
void |
parseStyleSheet(InputSource source)
Parse a CSS document.
|
void |
parseStyleSheet(String uri)
Parse a CSS document from a URI.
|
protected abstract boolean |
prio() |
protected abstract void |
ReInit(com.gargoylesoftware.css.parser.javacc.CharStream charStream) |
protected abstract SelectorList |
selectorList() |
void |
setDocumentHandler(DocumentHandler handler)
Allow an application to register a document event handler.
|
void |
setErrorHandler(CSSErrorHandler eh)
Allow an application to register an error event handler.
|
void |
setIeStarHackAccepted(boolean accepted) |
protected abstract void |
styleDeclaration() |
protected abstract void |
styleSheet() |
protected abstract void |
styleSheetRuleSingle() |
protected CSSParseException |
toCSSParseException(DOMException e) |
protected CSSParseException |
toCSSParseException(String messageKey,
Object[] msgParams,
Locator locator) |
protected CSSParseException |
toCSSParseException(String key,
com.gargoylesoftware.css.parser.javacc.ParseException e) |
protected CSSParseException |
toCSSParseException(com.gargoylesoftware.css.parser.javacc.TokenMgrError e) |
String |
unescape(String s,
boolean unescapeDoubleQuotes)
Unescapes escaped characters in the specified string, according to the
CSS specification.
|
protected DocumentHandler getDocumentHandler()
public void setDocumentHandler(DocumentHandler handler)
CSSParserIf 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.
setDocumentHandler in interface CSSParserhandler - The document handler.DocumentHandlerprotected CSSErrorHandler getErrorHandler()
public void setErrorHandler(CSSErrorHandler eh)
CSSParserIf 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.
setErrorHandler in interface CSSParsereh - The error handler.CSSErrorHandler,
CSSExceptionprotected InputSource getInputSource()
public void setIeStarHackAccepted(boolean accepted)
setIeStarHackAccepted in interface CSSParseraccepted - trur if the parser should accept ie star hackpublic boolean isIeStarHackAccepted()
isIeStarHackAccepted in interface CSSParserprotected Locator createLocator(com.gargoylesoftware.css.parser.javacc.Token t)
protected CSSParseException toCSSParseException(String key, com.gargoylesoftware.css.parser.javacc.ParseException e)
protected CSSParseException toCSSParseException(DOMException e)
protected CSSParseException toCSSParseException(com.gargoylesoftware.css.parser.javacc.TokenMgrError e)
protected CSSParseException toCSSParseException(String messageKey, Object[] msgParams, Locator locator)
protected CSSParseException createSkipWarning(String key, CSSParseException e)
public void parseStyleSheet(InputSource source) throws IOException
CSSParserThe 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.
parseStyleSheet in interface CSSParsersource - The input source for the top-level of the
CSS document.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.InputSource,
CSSParser.parseStyleSheet(java.lang.String),
CSSParser.setDocumentHandler(com.gargoylesoftware.css.parser.DocumentHandler),
CSSParser.setErrorHandler(com.gargoylesoftware.css.parser.CSSErrorHandler)public void parseStyleSheet(String uri) throws IOException
CSSParserThis method is a shortcut for the common case of reading a document from a URI. It is the exact equivalent of the following:
parse(new InputSource(uri));
The URI must be fully resolved by the application before it is passed to the parser.
parseStyleSheet in interface CSSParseruri - The URI.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.CSSParser.parseStyleSheet(InputSource)public void parseStyleDeclaration(InputSource source) throws IOException
CSSParserparseStyleDeclaration in interface CSSParsersource - source to be parsedIOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.public void parseRule(InputSource source) throws IOException
CSSParserparseRule in interface CSSParsersource - source to be parsedIOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.public SelectorList parseSelectors(InputSource source) throws IOException
CSSParserparseSelectors in interface CSSParsersource - source to be parsedIOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.public LexicalUnit parsePropertyValue(InputSource source) throws IOException
CSSParserparsePropertyValue in interface CSSParsersource - source to be parsedIOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.public boolean parsePriority(InputSource source) throws IOException
CSSParserparsePriority in interface CSSParsersource - source to be parsedIOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.public MediaQueryList parseMedia(InputSource source) throws IOException
IOExceptionpublic abstract String getParserVersion()
getParserVersion in interface CSSParserprotected abstract String getGrammarUri()
protected abstract void ReInit(com.gargoylesoftware.css.parser.javacc.CharStream charStream)
protected abstract void styleSheet()
throws CSSParseException,
com.gargoylesoftware.css.parser.javacc.ParseException
CSSParseExceptioncom.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract void styleDeclaration()
throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract void styleSheetRuleSingle()
throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract SelectorList parseSelectorsInternal() throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract SelectorList selectorList() throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract LexicalUnit expr() throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract boolean prio()
throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected abstract void mediaList(MediaQueryList ml) throws com.gargoylesoftware.css.parser.javacc.ParseException
com.gargoylesoftware.css.parser.javacc.ParseExceptionprotected void handleStartDocument()
protected void handleEndDocument()
protected void handleImportStyle(String uri, MediaQueryList media, String defaultNamespaceURI, Locator locator)
protected void handleStartMedia(MediaQueryList media, Locator locator)
protected void handleEndMedia(MediaQueryList media)
protected void handleStartFontFace(Locator locator)
protected void handleEndFontFace()
protected void handleSelector(Selector selector)
protected void handleStartSelector(SelectorList selectors, Locator locator)
protected void handleEndSelector(SelectorList selectors)
protected void handleProperty(String name, LexicalUnit value, boolean important, Locator locator)
protected LexicalUnit functionInternal(LexicalUnit prev, String funct, LexicalUnit params)
protected LexicalUnit hexcolorInternal(LexicalUnit prev, com.gargoylesoftware.css.parser.javacc.Token t)
protected int intValue(char op,
String s)
protected float floatValue(char op,
String s)
protected int getLastNumPos(String s)
public String unescape(String s, boolean unescapeDoubleQuotes)
Copyright © 2018. All rights reserved.