|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.batik.css.parser.Parser
This class implements the Parser interface.
| Field Summary | |
static java.lang.String |
BUNDLE_CLASSNAME
The default resource bundle base name. |
protected ConditionFactory |
conditionFactory
The condition factory. |
protected int |
current
The current lexical unit. |
protected DocumentHandler |
documentHandler
The document handler. |
protected java.lang.String |
documentURI
The document URI. |
protected ErrorHandler |
errorHandler
The error handler. |
protected LocalizableSupport |
localizableSupport
The localizable support. |
protected java.lang.String |
pseudoElement
To store the current pseudo element. |
protected Scanner |
scanner
The scanner used to scan the input source. |
protected SelectorFactory |
selectorFactory
The selector factory. |
| Constructor Summary | |
Parser()
|
|
| Method Summary | |
protected CSSParseException |
createCSSParseException(java.lang.String key)
Creates a parse exception. |
protected CSSParseException |
createCSSParseException(java.lang.String key,
java.lang.Object[] params)
Creates a parse exception. |
protected Scanner |
createScanner(InputSource source)
Creates a scanner, given an InputSource. |
protected LexicalUnit |
dimension(boolean positive,
LexicalUnit prev)
Converts the current lexical unit to a dimension. |
java.lang.String |
formatMessage(java.lang.String key,
java.lang.Object[] args)
Implements Localizable.formatMessage(String,Object[]). |
java.util.Locale |
getLocale()
Implements Localizable.getLocale(). |
java.lang.String |
getParserVersion()
SAC: Implements Parser.getParserVersion(). |
protected LexicalUnit |
hexcolor(LexicalUnit prev)
Converts a hash unit to a RGB color. |
protected boolean |
isPseudoElement(java.lang.String s)
Tells whether or not the given string represents a pseudo-element. |
protected int |
next()
Advances to the next token, ignoring comments. |
protected int |
nextIgnoreSpaces()
Advances to the next token and skip the spaces, ignoring comments. |
protected float |
number(boolean positive)
Converts the current lexical unit to a float. |
protected void |
parseAtRule()
Parses an unknown rule. |
protected LexicalUnit |
parseExpression(boolean param)
Parses a CSS2 expression. |
protected void |
parseFontFaceRule()
Parses a font-face rule. |
protected LexicalUnit |
parseFunction(boolean positive,
LexicalUnit prev)
Parses a CSS2 function. |
protected void |
parseImportRule()
Parses an import rule. |
SACMediaList |
parseMedia(java.lang.String mediaText)
Implements ExtendedParser.parseMedia(String). |
protected CSSSACMediaList |
parseMediaList()
Parses a media list. |
protected void |
parseMediaRule()
Parses a media rule. |
protected void |
parsePageRule()
Parses a page rule. |
boolean |
parsePriority(InputSource source)
SAC: Implements Parser.parsePriority(InputSource). |
boolean |
parsePriority(java.lang.String source)
Implements ExtendedParser.parsePriority(String). |
protected boolean |
parsePriorityInternal()
Parses the priority using the current scanner. |
LexicalUnit |
parsePropertyValue(InputSource source)
SAC: Implements Parser.parsePropertyValue(InputSource). |
LexicalUnit |
parsePropertyValue(java.lang.String source)
Implements ExtendedParser.parsePropertyValue(String). |
protected LexicalUnit |
parsePropertyValueInternal()
Parses property value using the current scanner. |
protected void |
parseRule()
Parses a rule. |
void |
parseRule(InputSource source)
SAC: Implements Parser.parseRule(InputSource). |
void |
parseRule(java.lang.String source)
Implements ExtendedParser.parseRule(String). |
protected void |
parseRuleInternal()
Parses a rule using the current scanner. |
protected void |
parseRuleSet()
Parses a ruleset. |
protected Selector |
parseSelector()
Parses a selector. |
protected SelectorList |
parseSelectorList()
Parses a selector list |
SelectorList |
parseSelectors(InputSource source)
SAC: Implements Parser.parseSelectors(InputSource). |
SelectorList |
parseSelectors(java.lang.String source)
Implements ExtendedParser.parseSelectors(String). |
protected SelectorList |
parseSelectorsInternal()
Parses selectors using the current scanner. |
protected SimpleSelector |
parseSimpleSelector()
Parses a simple selector. |
protected void |
parseStyleDeclaration(boolean inSheet)
Parses the given reader. |
void |
parseStyleDeclaration(InputSource source)
SAC: Implements Parser.parseStyleDeclaration(InputSource). |
void |
parseStyleDeclaration(java.lang.String source)
Implements ExtendedParser.parseStyleDeclaration(String). |
protected void |
parseStyleDeclarationInternal()
Parses a style declaration using the current scanner. |
void |
parseStyleSheet(InputSource source)
SAC: Implements Parser.parseStyleSheet(InputSource). |
void |
parseStyleSheet(java.lang.String uri)
SAC: Implements Parser.parseStyleSheet(String). |
protected LexicalUnit |
parseTerm(LexicalUnit prev)
Parses a CSS2 term. |
protected void |
reportError(CSSParseException e)
Reports a parsing error. |
protected void |
reportError(java.lang.String key)
Reports a parsing error. |
protected void |
reportError(java.lang.String key,
java.lang.Object[] params)
Reports a parsing error. |
void |
setConditionFactory(ConditionFactory factory)
SAC: Implements Parser.setConditionFactory(ConditionFactory). |
void |
setDocumentHandler(DocumentHandler handler)
SAC: Implements Parser.setDocumentHandler(DocumentHandler). |
void |
setErrorHandler(ErrorHandler handler)
SAC: Implements Parser.setErrorHandler(ErrorHandler). |
void |
setLocale(java.util.Locale locale)
SAC: Implements Parser.setLocale(Locale). |
void |
setSelectorFactory(SelectorFactory factory)
SAC: Implements Parser.setSelectorFactory(SelectorFactory). |
protected int |
skipSpaces()
Skips the white spaces. |
protected int |
skipSpacesAndCDOCDC()
Skips the white spaces and CDO/CDC units. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String BUNDLE_CLASSNAME
protected LocalizableSupport localizableSupport
protected Scanner scanner
protected int current
protected DocumentHandler documentHandler
protected SelectorFactory selectorFactory
protected ConditionFactory conditionFactory
protected ErrorHandler errorHandler
protected java.lang.String pseudoElement
protected java.lang.String documentURI
| Constructor Detail |
public Parser()
| Method Detail |
public java.lang.String getParserVersion()
Parser.getParserVersion().getParserVersion in interface Parser
public void setLocale(java.util.Locale locale)
throws CSSException
Parser.setLocale(Locale).setLocale in interface Parserorg.apache.batik.i18n.Localizablel - The locale to set.public java.util.Locale getLocale()
Localizable.getLocale().getLocale in interface Localizable
public java.lang.String formatMessage(java.lang.String key,
java.lang.Object[] args)
throws java.util.MissingResourceException
Localizable.formatMessage(String,Object[]).formatMessage in interface Localizableorg.apache.batik.i18n.Localizablekey - The key used to retreive the message from the resource
bundle.args - The objects that compose the message.java.util.MissingResourceException - if the key is not in the bundle.public void setDocumentHandler(DocumentHandler handler)
Parser.setDocumentHandler(DocumentHandler).setDocumentHandler in interface Parserorg.w3c.css.sac.Parserhandler - The document handler.DocumentHandlerpublic void setSelectorFactory(SelectorFactory factory)
Parser.setSelectorFactory(SelectorFactory).setSelectorFactory in interface Parserpublic void setConditionFactory(ConditionFactory factory)
Parser.setConditionFactory(ConditionFactory).setConditionFactory in interface Parserpublic void setErrorHandler(ErrorHandler handler)
Parser.setErrorHandler(ErrorHandler).setErrorHandler in interface Parserorg.w3c.css.sac.Parserhandler - The error handler.ErrorHandler,
CSSException
public void parseStyleSheet(InputSource source)
throws CSSException,
java.io.IOException
Parser.parseStyleSheet(InputSource).parseStyleSheet in interface Parserorg.w3c.css.sac.Parsersource - The input source for the top-level of the
CSS document.CSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.InputSource,
Parser.parseStyleSheet(java.lang.String),
Parser.setDocumentHandler(org.w3c.css.sac.DocumentHandler),
Parser.setErrorHandler(org.w3c.css.sac.ErrorHandler)
public void parseStyleSheet(java.lang.String uri)
throws CSSException,
java.io.IOException
Parser.parseStyleSheet(String).parseStyleSheet in interface Parserorg.w3c.css.sac.Parseruri - The URI.CSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.Parser.parseStyleSheet(InputSource)
public void parseStyleDeclaration(InputSource source)
throws CSSException,
java.io.IOException
Parser.parseStyleDeclaration(InputSource).parseStyleDeclaration in interface Parserorg.w3c.css.sac.ParserstyleValue - The declaration.CSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
protected void parseStyleDeclarationInternal()
throws CSSException,
java.io.IOException
public void parseRule(InputSource source)
throws CSSException,
java.io.IOException
Parser.parseRule(InputSource).parseRule in interface Parserorg.w3c.css.sac.ParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
protected void parseRuleInternal()
throws CSSException,
java.io.IOException
public SelectorList parseSelectors(InputSource source)
throws CSSException,
java.io.IOException
Parser.parseSelectors(InputSource).parseSelectors in interface Parserorg.w3c.css.sac.ParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
protected SelectorList parseSelectorsInternal()
throws CSSException,
java.io.IOException
public LexicalUnit parsePropertyValue(InputSource source)
throws CSSException,
java.io.IOException
Parser.parsePropertyValue(InputSource).parsePropertyValue in interface Parserorg.w3c.css.sac.ParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
protected LexicalUnit parsePropertyValueInternal()
throws CSSException,
java.io.IOException
public boolean parsePriority(InputSource source)
throws CSSException,
java.io.IOException
Parser.parsePriority(InputSource).parsePriority in interface Parserorg.w3c.css.sac.ParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
protected boolean parsePriorityInternal()
throws CSSException,
java.io.IOException
protected void parseRule()
protected void parseAtRule()
protected void parseImportRule()
protected CSSSACMediaList parseMediaList()
protected void parseFontFaceRule()
protected void parsePageRule()
protected void parseMediaRule()
protected void parseRuleSet()
protected SelectorList parseSelectorList()
protected Selector parseSelector()
protected SimpleSelector parseSimpleSelector()
protected boolean isPseudoElement(java.lang.String s)
protected void parseStyleDeclaration(boolean inSheet)
throws CSSException
protected LexicalUnit parseExpression(boolean param)
lex - The type of the current lexical unit.protected LexicalUnit parseTerm(LexicalUnit prev)
protected LexicalUnit parseFunction(boolean positive,
LexicalUnit prev)
protected LexicalUnit hexcolor(LexicalUnit prev)
protected Scanner createScanner(InputSource source)
protected int skipSpaces()
protected int skipSpacesAndCDOCDC()
protected float number(boolean positive)
protected LexicalUnit dimension(boolean positive,
LexicalUnit prev)
protected int next()
protected int nextIgnoreSpaces()
protected void reportError(java.lang.String key)
protected void reportError(java.lang.String key,
java.lang.Object[] params)
protected void reportError(CSSParseException e)
protected CSSParseException createCSSParseException(java.lang.String key)
protected CSSParseException createCSSParseException(java.lang.String key,
java.lang.Object[] params)
public void parseStyleDeclaration(java.lang.String source)
throws CSSException,
java.io.IOException
ExtendedParser.parseStyleDeclaration(String).parseStyleDeclaration in interface ExtendedParserorg.apache.batik.css.parser.ExtendedParserstyleValue - The declaration.CSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
public void parseRule(java.lang.String source)
throws CSSException,
java.io.IOException
ExtendedParser.parseRule(String).parseRule in interface ExtendedParserorg.apache.batik.css.parser.ExtendedParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
public SelectorList parseSelectors(java.lang.String source)
throws CSSException,
java.io.IOException
ExtendedParser.parseSelectors(String).parseSelectors in interface ExtendedParserorg.apache.batik.css.parser.ExtendedParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
public LexicalUnit parsePropertyValue(java.lang.String source)
throws CSSException,
java.io.IOException
ExtendedParser.parsePropertyValue(String).parsePropertyValue in interface ExtendedParserorg.apache.batik.css.parser.ExtendedParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
public boolean parsePriority(java.lang.String source)
throws CSSException,
java.io.IOException
ExtendedParser.parsePriority(String).parsePriority in interface ExtendedParserorg.apache.batik.css.parser.ExtendedParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
public SACMediaList parseMedia(java.lang.String mediaText)
throws CSSException,
java.io.IOException
ExtendedParser.parseMedia(String).parseMedia in interface ExtendedParserorg.apache.batik.css.parser.ExtendedParserCSSException - Any CSS exception, possibly
wrapping another exception.java.io.IOException - An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||