public class CSSParser extends Object implements ICSSParser
Modifier and Type | Field and Description |
---|---|
protected int |
m_column |
protected boolean |
m_cr |
protected ICSSHandler |
m_handler |
protected int |
m_line |
protected static int |
NESTED_ATRULE
Atrule block or simple value.
|
protected static int |
NESTED_DECLARATION
Declaration value (atrule or simple value).
|
protected static int |
NESTED_RULESET
Ruleset block.
|
protected static int |
STATE_ANY
Looking for new atrules, rulesets, or attrule/declaration values.
|
protected static int |
STATE_ATRULE_NAME
Looking for end of atrule name.
|
protected static int |
STATE_RULESET_PROPERTY
Looking for end of declaration property.
|
Constructor and Description |
---|
CSSParser() |
Modifier and Type | Method and Description |
---|---|
protected int |
___appendEscapedChar(Reader input,
StringBuffer token)
this actually unescapes; but we really should preserve escaped values
|
protected int |
appendEscapedChar(Reader input,
StringBuffer token)
this preserves escaped values
|
ICSSHandler |
getHandler() |
protected int |
hexCharToInt(int ch) |
protected boolean |
isWhitespace(int ch) |
void |
parse(Reader input,
String uri,
String charset) |
protected int |
read(Reader input) |
protected void |
readComment(Reader input) |
void |
setHandler(ICSSHandler handler) |
protected StringBuffer |
trimWhitespace(StringBuffer buf) |
protected static final int STATE_ANY
protected static final int STATE_ATRULE_NAME
protected static final int STATE_RULESET_PROPERTY
protected static final int NESTED_ATRULE
protected static final int NESTED_RULESET
protected static final int NESTED_DECLARATION
protected boolean m_cr
protected int m_line
protected int m_column
protected ICSSHandler m_handler
public ICSSHandler getHandler()
getHandler
in interface ICSSSource
public void setHandler(ICSSHandler handler)
setHandler
in interface ICSSSource
public void parse(Reader input, String uri, String charset) throws CSSException, IOException
parse
in interface ICSSParser
CSSException
IOException
protected final boolean isWhitespace(int ch)
protected final int hexCharToInt(int ch)
protected StringBuffer trimWhitespace(StringBuffer buf)
protected int appendEscapedChar(Reader input, StringBuffer token) throws IOException
input
- Input stream after initial escape signal char ('\\').token
- Buffer to which to append the escaped char value.IOException
protected int ___appendEscapedChar(Reader input, StringBuffer token) throws IOException
input
- Input stream after initial escape signal char ('\\').token
- Buffer to which to append the escaped char value.IOException
protected void readComment(Reader input) throws CSSException, IOException
input
- Input stream directly after comment start chars ('/*').CSSException
IOException
protected int read(Reader input) throws IOException
IOException