com.guiseframework.platform.web.css
Class CSSProcessor

java.lang.Object
  extended by com.guiseframework.platform.web.css.CSSProcessor
Direct Known Subclasses:
GuiseCSSProcessor

public class CSSProcessor
extends java.lang.Object

Class to parse CSS stylesheets in order to manipulate them within Guise.

Author:
Garret Wilson
See Also:
CSS 3 Syntax

Constructor Summary
CSSProcessor()
           
 
Method Summary
static void parseDeclarationBlock(com.globalmentor.io.ParseReader parseReader, Rule rule)
          Parses an input stream is expected to contain a block of declaration names and values, with appropriate beginning and ending delimiters.
static boolean parseDeclarations(com.globalmentor.io.ParseReader parseReader, Rule rule)
          Parses an input stream is expected to contain a set of declaration names and values.
protected static Rule parseRule(com.globalmentor.io.ParseReader parseReader)
          Parses an input stream that is expected to begin with a CSS rule.
protected static void parseStylesheetContent(com.globalmentor.io.ParseReader parseReader, CSSStylesheet stylesheet)
          Parses an input stream that contains stylesheet information.
 CSSStylesheet process(com.globalmentor.io.ParseReader parseReader)
          Processes a CSS stylesheet.
protected static void skipWhitespaceCommentsEOF(com.globalmentor.io.ParseReader parseReader)
          Skips whitespace and comments without throwing an error if the end of the input was reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSProcessor

public CSSProcessor()
Method Detail

skipWhitespaceCommentsEOF

protected static void skipWhitespaceCommentsEOF(com.globalmentor.io.ParseReader parseReader)
                                         throws java.io.IOException
Skips whitespace and comments without throwing an error if the end of the input was reached. Peeking is reset.

Parameters:
parseReader - The reader from which to retrieve characters.
Throws:
java.io.IOException

parseDeclarations

public static boolean parseDeclarations(com.globalmentor.io.ParseReader parseReader,
                                        Rule rule)
                                 throws java.io.IOException
Parses an input stream is expected to contain a set of declaration names and values.

Parameters:
parseReader - The reader from which to retrieve characters.
rule - The rule which will hold the declarations.
Returns:
true if the end-of-rule-group character was found, false if the end of the stream was reached.
Throws:
java.io.IOException

parseDeclarationBlock

public static void parseDeclarationBlock(com.globalmentor.io.ParseReader parseReader,
                                         Rule rule)
                                  throws java.io.IOException
Parses an input stream is expected to contain a block of declaration names and values, with appropriate beginning and ending delimiters.

Parameters:
parseReader - The reader from which to retrieve characters.
rule - The rule which will hold the declarations.
Throws:
java.io.IOException

parseRule

protected static Rule parseRule(com.globalmentor.io.ParseReader parseReader)
                         throws java.io.IOException
Parses an input stream that is expected to begin with a CSS rule.

Parameters:
parseReader - The reader from which to retrieve characters.
Returns:
A new CSS rule constructed from the reader.
Throws:
java.io.IOException

parseStylesheetContent

protected static void parseStylesheetContent(com.globalmentor.io.ParseReader parseReader,
                                             CSSStylesheet stylesheet)
                                      throws java.io.IOException
Parses an input stream that contains stylesheet information.

Parameters:
parseReader - The reader from which to retrieve characters.
stylesheet - The stylesheet being constructed.
Throws:
java.io.IOException

process

public CSSStylesheet process(com.globalmentor.io.ParseReader parseReader)
                      throws java.io.IOException
Processes a CSS stylesheet.

Parameters:
parseReader - The reader from which to retrieve characters.
Returns:
stylesheet The constructed stylesheet.
Throws:
java.io.IOException


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.