| java.lang.Object org.wings.style.CSSParser
CSSParser | class CSSParser (Code) | | A CSS parser. This works by way of a delegate that implements the
CSSParserCallback interface. The delegate is notified of the following
events:
- Import statement:
handleImport
- Selectors
handleSelector . This is invoked for each
string. For example if the Reader contained p, bar , a {}, the delegate
would be notified 4 times, for 'p,' 'bar' ',' and 'a'.
- When a rule starts,
startRule
- Properties in the rule via the
handleProperty . This
is invoked one per property/value key, eg font size: foo;, would
cause the delegate to be notified once with a value of 'font size'.
- Values in the rule via the
handleValue , this is notified
for the total value.
- When a rule ends,
endRule
This will parse much more than CSS 1, and loosely implements the
recommendation for Forward-compatible parsing in section
7.1 of the CSS spec found at:
http://www.w3.org/TR/REC-CSS1.
If an error results in parsing, a RuntimeException will be thrown.
This will preserve case. If the callback wishes to treat certain poritions
case insensitively (such as selectors), it should use toLowerCase, or
something similar.
author: Scott Violet version: 1.5 03/20/00 |
Inner Class :static interface CSSParserCallback | |
Method Summary | |
void | parse(Reader reader, CSSParserCallback callback, boolean inRule) |
|
|