public class StyleParser extends HandlerBase
Modifier and Type | Class and Description |
---|---|
static class |
StyleParser.Warning
Warning information returned by
getWarnings() . |
Modifier and Type | Field and Description |
---|---|
protected URL |
baseURL |
protected String[] |
lastParseError |
static StyleParser.Warning[] |
NO_WARNINGS
An empty list of warnings.
|
static String |
PARSE_PREFIX
Before
parse(java.lang.String, java.net.URL, com.xmlmind.xml.name.PrefixToNamespace, com.xmlmind.xmledit.stylesheet.StyleSpec) is invoked, specified CSS properties
are prefixed with this "x { " string. |
static String |
PARSE_SUFFIX
Before
parse(java.lang.String, java.net.URL, com.xmlmind.xml.name.PrefixToNamespace, com.xmlmind.xmledit.stylesheet.StyleSpec) is invoked, specified CSS properties
are suffixed with this "; }"" string. |
protected Parser |
parser |
protected PrefixToNamespace |
prefixToNS |
protected ShorthandHandler |
shorthand |
protected StyleSpec |
spec |
protected ArrayList<StyleParser.Warning> |
warnings |
Constructor and Description |
---|
StyleParser()
Constructs a style parser.
|
Modifier and Type | Method and Description |
---|---|
void |
error(URL url,
int lineNumber,
int columnNumber,
String message) |
StyleParser.Warning[] |
getWarnings()
Returns the (possibly empty) list of syntax and semantic errors found
in last parsed content.
|
void |
parse(String s,
URL baseURL,
PrefixToNamespace prefixToNS,
StyleSpec spec)
Parses specified CSS properties.
|
void |
property(String name,
ValueComponent[] components,
boolean important) |
protected void |
warning(String message) |
atRule, beginFontFace, beginMedia, beginPage, beginProperties, beginRule, beginSelectors, beginStyleSheet, endFontFace, endMedia, endPage, endProperties, endRule, endSelectors, endStyleSheet, namespace, resolveURI, script, selector
public static final StyleParser.Warning[] NO_WARNINGS
public static final String PARSE_PREFIX
parse(java.lang.String, java.net.URL, com.xmlmind.xml.name.PrefixToNamespace, com.xmlmind.xmledit.stylesheet.StyleSpec)
is invoked, specified CSS properties
are prefixed with this "x { " string.
This has an effect on the location of the warnings reported by the parser.
public static final String PARSE_SUFFIX
parse(java.lang.String, java.net.URL, com.xmlmind.xml.name.PrefixToNamespace, com.xmlmind.xmledit.stylesheet.StyleSpec)
is invoked, specified CSS properties
are suffixed with this "; }"" string.
This may have an effect on the location of the warnings reported by the parser.
protected Parser parser
protected ShorthandHandler shorthand
protected String[] lastParseError
protected ArrayList<StyleParser.Warning> warnings
protected URL baseURL
protected PrefixToNamespace prefixToNS
protected StyleSpec spec
public void parse(String s, URL baseURL, PrefixToNamespace prefixToNS, StyleSpec spec)
s
- a number of CSS properties separated by ';'
(like in the value of the HTML style attribute)baseURL
- base URL used to resolve relative URLs possibly
found in sprefixToNS
- used to parse XML qualified namesspec
- parsed properties are stored in this structurePARSE_PREFIX
,
PARSE_SUFFIX
public StyleParser.Warning[] getWarnings()
public final void property(String name, ValueComponent[] components, boolean important)
property
in interface Handler
property
in class HandlerBase
public final void error(URL url, int lineNumber, int columnNumber, String message)
error
in interface Handler
error
in class HandlerBase
protected final void warning(String message)