Class CSSProcessor
java.lang.Object
io.guise.framework.platform.web.css.CSSProcessor
Class to parse CSS stylesheets in order to manipulate them within Guise.
- Author:
- Garret Wilson
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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.
-
Constructor Details
-
CSSProcessor
public CSSProcessor()
-
-
Method Details
-
skipWhitespaceCommentsEOF
protected static void skipWhitespaceCommentsEOF(com.globalmentor.io.ParseReader parseReader) throws 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:
IOException
- Thrown if there is an error reading the input or the input is invalid.
-
parseDeclarations
public static boolean parseDeclarations(com.globalmentor.io.ParseReader parseReader, Rule rule) throws 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:
IOException
- Thrown if there is an error reading the input, the input is invalid, or the end of the input was reached unexpectedly.
-
parseDeclarationBlock
public static void parseDeclarationBlock(com.globalmentor.io.ParseReader parseReader, Rule rule) throws 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:
IOException
- Thrown if there is an error reading the input, the input is invalid, or the end of the input was reached unexpectedly.
-
parseRule
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:
IOException
- Thrown if there is an error reading the input, the input is invalid, or the end of the input was reached unexpectedly.
-
parseStylesheetContent
protected static void parseStylesheetContent(com.globalmentor.io.ParseReader parseReader, CSSStylesheet stylesheet) throws IOException Parses an input stream that contains stylesheet information.- Parameters:
parseReader
- The reader from which to retrieve characters.stylesheet
- The stylesheet being constructed.- Throws:
IOException
- Thrown if there is an error reading the input, the input is invalid, or the end of the input was reached unexpectedly.
-
process
Processes a CSS stylesheet.- Parameters:
parseReader
- The reader from which to retrieve characters.- Returns:
- stylesheet The constructed stylesheet.
- Throws:
IOException
- Thrown if there is an error reading the input, the input is invalid, or the end of the input was reached unexpectedly.
-