luxor.css
Class CssParser

java.lang.Object
  |
  +--luxor.css.CssParser

public class CssParser
extends java.lang.Object


Field Summary
protected  ConditionFactory _conditionFactory
           
protected  int _current
          The current token.
protected  DocumentHandler _documentHandler
           
protected  java.lang.String _documentUri
           
protected  ErrorHandler _errorHandler
           
protected  CssLexer _lexer
          The lexer used to break the input source into tokens.
protected  SelectorFactory _selectorFactory
           
 
Constructor Summary
CssParser()
           
 
Method Summary
protected  java.io.Reader characterStream(InputSource source)
          Converts the given input source into a Reader.
protected  java.io.Reader characterStream(InputSource source, java.io.InputStream is)
          Converts the given input stream into a Reader.
protected  CssParseException createCssParseException(java.lang.String key)
           
protected  CssParseException createCssParseException(java.lang.String key, java.lang.Object[] params)
           
protected  CssValue dimension(boolean positive, CssValue prev)
          Converts the current lexical unit to a dimension.
 java.lang.String formatMessage(java.lang.String key, java.lang.Object[] args)
           
protected  CssValue hexcolor(CssValue prev)
          Converts a hash unit to a RGB color.
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  CssValue parseExpression(boolean param)
          Parses a CSS2 expression.
protected  CssValue parseFunction(boolean positive, CssValue prev)
          Parses a CSS2 function.
 CssValue parsePropertyValue(InputSource source)
           
 CssValue parsePropertyValue(java.lang.String source)
           
protected  CssValue parsePropertyValueInternal()
          Parses property value using the current scanner.
protected  void parseRule()
          Parses a rule.
 void parseRule(InputSource source)
           
 void parseRule(java.lang.String source)
           
protected  void parseRuleInternal()
          Parses a rule using the current scanner.
protected  void parseRuleSet()
          Parses a ruleset.
protected  Selector parseSelector()
          Parses a selector.
protected  java.util.List parseSelectorList()
          Parses a selector list
 java.util.List parseSelectors(InputSource source)
           
 java.util.List parseSelectors(java.lang.String source)
           
protected  java.util.List parseSelectorsInternal()
          Parses selectors using the current scanner.
protected  Selector parseSimpleSelector()
          Parses a simple selector.
protected  void parseStyleDeclaration(boolean inSheet)
          Parses the given reader.
 void parseStyleDeclaration(InputSource source)
           
 void parseStyleDeclaration(java.lang.String source)
           
protected  void parseStyleDeclarationInternal()
          Parses a style declaration using the current scanner.
 void parseStyleSheet(InputSource source)
           
 void parseStyleSheet(java.lang.String uri)
           
protected  CssValue parseTerm(CssValue 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)
           
 void setDocumentHandler(DocumentHandler handler)
           
 void setErrorHandler(ErrorHandler handler)
           
 void setSelectorFactory(SelectorFactory factory)
           
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

_conditionFactory

protected ConditionFactory _conditionFactory

_current

protected int _current
The current token.


_documentHandler

protected DocumentHandler _documentHandler

_documentUri

protected java.lang.String _documentUri

_errorHandler

protected ErrorHandler _errorHandler

_lexer

protected CssLexer _lexer
The lexer used to break the input source into tokens.


_selectorFactory

protected SelectorFactory _selectorFactory
Constructor Detail

CssParser

public CssParser()
Method Detail

setConditionFactory

public void setConditionFactory(ConditionFactory factory)

setDocumentHandler

public void setDocumentHandler(DocumentHandler handler)

setErrorHandler

public void setErrorHandler(ErrorHandler handler)

setSelectorFactory

public void setSelectorFactory(SelectorFactory factory)

formatMessage

public java.lang.String formatMessage(java.lang.String key,
                                      java.lang.Object[] args)

parsePropertyValue

public CssValue parsePropertyValue(InputSource source)
                            throws CssParseException,
                                   java.io.IOException
CssParseException
java.io.IOException

parsePropertyValue

public CssValue parsePropertyValue(java.lang.String source)
                            throws CssParseException,
                                   java.io.IOException
CssParseException
java.io.IOException

parseRule

public void parseRule(InputSource source)
               throws CssParseException,
                      java.io.IOException
CssParseException
java.io.IOException

parseRule

public void parseRule(java.lang.String source)
               throws CssParseException,
                      java.io.IOException
CssParseException
java.io.IOException

parseSelectors

public java.util.List parseSelectors(InputSource source)
                              throws CssParseException,
                                     java.io.IOException
CssParseException
java.io.IOException

parseSelectors

public java.util.List parseSelectors(java.lang.String source)
                              throws CssParseException,
                                     java.io.IOException
CssParseException
java.io.IOException

parseStyleDeclaration

public void parseStyleDeclaration(InputSource source)
                           throws CssParseException,
                                  java.io.IOException
CssParseException
java.io.IOException

parseStyleDeclaration

public void parseStyleDeclaration(java.lang.String source)
                           throws CssParseException,
                                  java.io.IOException
CssParseException
java.io.IOException

parseStyleSheet

public void parseStyleSheet(InputSource source)
                     throws CssParseException,
                            java.io.IOException
CssParseException
java.io.IOException

parseStyleSheet

public void parseStyleSheet(java.lang.String uri)
                     throws CssParseException,
                            java.io.IOException
CssParseException
java.io.IOException

characterStream

protected java.io.Reader characterStream(InputSource source)
                                  throws CssParseException
Converts the given input source into a Reader.

CssParseException

characterStream

protected java.io.Reader characterStream(InputSource source,
                                         java.io.InputStream is)
Converts the given input stream into a Reader.


createCssParseException

protected CssParseException createCssParseException(java.lang.String key)

createCssParseException

protected CssParseException createCssParseException(java.lang.String key,
                                                    java.lang.Object[] params)

dimension

protected CssValue dimension(boolean positive,
                             CssValue prev)
                      throws CssParseException
Converts the current lexical unit to a dimension.

CssParseException

hexcolor

protected CssValue hexcolor(CssValue prev)
                     throws CssParseException
Converts a hash unit to a RGB color.

CssParseException

next

protected int next()
Advances to the next token, ignoring comments.


nextIgnoreSpaces

protected int nextIgnoreSpaces()
Advances to the next token and skip the spaces, ignoring comments.


number

protected float number(boolean positive)
                throws CssParseException
Converts the current lexical unit to a float.

CssParseException

parseExpression

protected CssValue parseExpression(boolean param)
                            throws CssParseException
Parses a CSS2 expression.

CssParseException

parseFunction

protected CssValue parseFunction(boolean positive,
                                 CssValue prev)
                          throws CssParseException
Parses a CSS2 function.

CssParseException

parsePropertyValueInternal

protected CssValue parsePropertyValueInternal()
                                       throws CssParseException,
                                              java.io.IOException
Parses property value using the current scanner.

CssParseException
java.io.IOException

parseRule

protected void parseRule()
Parses a rule.


parseRuleInternal

protected void parseRuleInternal()
                          throws CssParseException,
                                 java.io.IOException
Parses a rule using the current scanner.

CssParseException
java.io.IOException

parseRuleSet

protected void parseRuleSet()
Parses a ruleset.


parseSelector

protected Selector parseSelector()
                          throws CssParseException
Parses a selector.

CssParseException

parseSelectorList

protected java.util.List parseSelectorList()
                                    throws CssParseException
Parses a selector list

CssParseException

parseSelectorsInternal

protected java.util.List parseSelectorsInternal()
                                         throws CssParseException,
                                                java.io.IOException
Parses selectors using the current scanner.

CssParseException
java.io.IOException

parseSimpleSelector

protected Selector parseSimpleSelector()
                                throws CssParseException
Parses a simple selector.

CssParseException

parseStyleDeclaration

protected void parseStyleDeclaration(boolean inSheet)
                              throws CssParseException
Parses the given reader.

CssParseException

parseStyleDeclarationInternal

protected void parseStyleDeclarationInternal()
                                      throws CssParseException,
                                             java.io.IOException
Parses a style declaration using the current scanner.

CssParseException
java.io.IOException

parseTerm

protected CssValue parseTerm(CssValue prev)
                      throws CssParseException
Parses a CSS2 term.

CssParseException

reportError

protected void reportError(java.lang.String key)
Reports a parsing error.


reportError

protected void reportError(java.lang.String key,
                           java.lang.Object[] params)
Reports a parsing error.


reportError

protected void reportError(CssParseException e)
Reports a parsing error.


skipSpaces

protected int skipSpaces()
Skips the white spaces.


skipSpacesAndCDOCDC

protected int skipSpacesAndCDOCDC()
Skips the white spaces and CDO/CDC untis.



Copyright 2001, 2002 Gerald Bauer. All Rights Reserved. Hosted by SourceForge Logo