|
||||||||||
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 static java.util.Map |
ENCODINGS
The CSS to Java encoding table. |
protected ErrorHandler |
errorHandler
The error handler. |
protected LocalizableSupport |
localizableSupport
The localizable support. |
static java.lang.String |
MIME_TYPE_CSS
|
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 java.io.Reader |
characterStream(InputSource source,
java.io.InputStream is,
java.lang.String enc)
Converts the given input stream into a Reader. |
protected java.io.Reader |
characterStream(InputSource source,
java.lang.String enc)
Converts the given input source into a Reader. |
protected CSSParseException |
createCSSParseException(java.lang.String key)
Creates a parse exception. |
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 java.lang.String |
javaEncoding(java.lang.String encoding)
Returns the Java encoding string mapped with the given CSS encoding string. |
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. |
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) . |
LexicalUnit |
parsePropertyValue(InputSource source)
SAC: Implements Parser.parsePropertyValue(InputSource) . |
protected void |
parseRule()
Parses a rule. |
void |
parseRule(InputSource source)
SAC: Implements Parser.parseRule(InputSource) . |
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) . |
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 |
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. |
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 untis. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.util.Map ENCODINGS
public static final java.lang.String MIME_TYPE_CSS
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 Parser
org.w3c.css.sac.Parser
locale
- A Java Locale object.CSSException
- Throws an exception
(using the previous or default locale) if the
requested locale is not supported.CSSException
,
CSSParseException
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 Localizable
org.apache.batik.i18n.Localizable
key
- 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 Parser
org.w3c.css.sac.Parser
handler
- The document handler.DocumentHandler
public void setSelectorFactory(SelectorFactory factory)
Parser.setSelectorFactory(SelectorFactory)
.setSelectorFactory
in interface Parser
public void setConditionFactory(ConditionFactory factory)
Parser.setConditionFactory(ConditionFactory)
.setConditionFactory
in interface Parser
public void setErrorHandler(ErrorHandler handler)
Parser.setErrorHandler(ErrorHandler)
.setErrorHandler
in interface Parser
org.w3c.css.sac.Parser
handler
- The error handler.ErrorHandler
,
CSSException
public void parseStyleSheet(InputSource source) throws CSSException, java.io.IOException
Parser.parseStyleSheet(InputSource)
.parseStyleSheet
in interface Parser
org.w3c.css.sac.Parser
source
- 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 Parser
org.w3c.css.sac.Parser
uri
- 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 Parser
org.w3c.css.sac.Parser
styleValue
- 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(InputSource source) throws CSSException, java.io.IOException
Parser.parseRule(InputSource)
.parseRule
in interface Parser
org.w3c.css.sac.Parser
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 SelectorList parseSelectors(InputSource source) throws CSSException, java.io.IOException
Parser.parseSelectors(InputSource)
.parseSelectors
in interface Parser
org.w3c.css.sac.Parser
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 LexicalUnit parsePropertyValue(InputSource source) throws CSSException, java.io.IOException
Parser.parsePropertyValue(InputSource)
.parsePropertyValue
in interface Parser
org.w3c.css.sac.Parser
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 boolean parsePriority(InputSource source) throws CSSException, java.io.IOException
Parser.parsePriority(InputSource)
.parsePriority
in interface Parser
org.w3c.css.sac.Parser
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 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 java.lang.String javaEncoding(java.lang.String encoding)
protected java.io.Reader characterStream(InputSource source, java.lang.String enc)
is
- The input source.enc
- The encoding or null.protected java.io.Reader characterStream(InputSource source, java.io.InputStream is, java.lang.String enc)
is
- The input source.enc
- The encoding or null.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(CSSParseException e)
protected CSSParseException createCSSParseException(java.lang.String key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |