Class CSSParser
java.lang.Object
com.webmethods.rtl.markup.css.parser.CSSParser
- All Implemented Interfaces:
ICSSParser
,ICSSSource
Simple css parser. Nnn-strict and not fully-conformant.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected boolean
protected ICSSHandler
protected int
protected static final int
Atrule block or simple value.protected static final int
Declaration value (atrule or simple value).protected static final int
Ruleset block.protected static final int
Looking for new atrules, rulesets, or attrule/declaration values.protected static final int
Looking for end of atrule name.protected static final int
Looking for end of declaration property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
___appendEscapedChar
(Reader input, StringBuffer token) this actually unescapes; but we really should preserve escaped valuesprotected int
appendEscapedChar
(Reader input, StringBuffer token) this preserves escaped valuesprotected final int
hexCharToInt
(int ch) protected final boolean
isWhitespace
(int ch) void
protected int
protected void
readComment
(Reader input) void
setHandler
(ICSSHandler handler) protected StringBuffer
-
Field Details
-
STATE_ANY
protected static final int STATE_ANYLooking for new atrules, rulesets, or attrule/declaration values.- See Also:
-
STATE_ATRULE_NAME
protected static final int STATE_ATRULE_NAMELooking for end of atrule name.- See Also:
-
STATE_RULESET_PROPERTY
protected static final int STATE_RULESET_PROPERTYLooking for end of declaration property.- See Also:
-
NESTED_ATRULE
protected static final int NESTED_ATRULEAtrule block or simple value.- See Also:
-
NESTED_RULESET
protected static final int NESTED_RULESETRuleset block.- See Also:
-
NESTED_DECLARATION
protected static final int NESTED_DECLARATIONDeclaration value (atrule or simple value).- See Also:
-
m_cr
protected boolean m_cr -
m_line
protected int m_line -
m_column
protected int m_column -
m_handler
-
-
Constructor Details
-
CSSParser
public CSSParser()
-
-
Method Details
-
getHandler
- Specified by:
getHandler
in interfaceICSSSource
-
setHandler
- Specified by:
setHandler
in interfaceICSSSource
-
parse
- Specified by:
parse
in interfaceICSSParser
- Throws:
CSSException
IOException
-
isWhitespace
protected final boolean isWhitespace(int ch) -
hexCharToInt
protected final int hexCharToInt(int ch) -
trimWhitespace
- Returns:
- Original buf.
-
appendEscapedChar
this preserves escaped values- Parameters:
input
- Input stream after initial escape signal char ('\\').token
- Buffer to which to append the escaped char value.- Returns:
- Next char after escape sequence.
- Throws:
IOException
-
___appendEscapedChar
this actually unescapes; but we really should preserve escaped values- Parameters:
input
- Input stream after initial escape signal char ('\\').token
- Buffer to which to append the escaped char value.- Returns:
- Next char after escape sequence.
- Throws:
IOException
-
readComment
- Parameters:
input
- Input stream directly after comment start chars ('/*').- Throws:
CSSException
IOException
-
read
- Throws:
IOException
-