public class StyleScanner
extends java.lang.Object
StyleScanner
scans CSS text and returns tokens.Modifier and Type | Class | Description |
---|---|---|
static class |
StyleScanner.Token |
Enumeration for the different types of Tokens in "CSS".
|
Constructor | Description |
---|---|
StyleScanner() |
Construct a
StyleScanner object, with empty input. |
StyleScanner(java.lang.String cssText) |
Construct a
StyleScanner object, with the given input. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getCurrLexeme() |
Returns the current lexeme after a call to
getNextToken . |
int |
getNextPosition() |
Returns the current position of the next token.
|
StyleScanner.Token |
getNextToken() |
Returns the
Token . |
void |
reset() |
Resets the scanner to the beginning of the CSS text.
|
void |
setCssText(java.lang.String cssText) |
Give the
StyleScanner another CSS text to scan. |
public StyleScanner()
StyleScanner
object, with empty input.public StyleScanner(java.lang.String cssText)
StyleScanner
object, with the given input.cssText
- The CSS text to scan.public StyleScanner.Token getNextToken()
Token
. After this call completes, the current
lexeme is available via a call to getCurrLexeme
.
Starts looking at the current offset, and once the token is found, then
the offset is advanced to the start of the next token.Token
.getCurrLexeme()
public java.lang.String getCurrLexeme()
getNextToken
.null
if
getNextToken
hasn't been called yet after a reset.getNextToken()
,
reset()
public int getNextPosition()
public void reset()
public void setCssText(java.lang.String cssText)
StyleScanner
another CSS text to scan.
Resets to the beginning of the string.cssText
- The css Text to scan.Copyright © 2012–2018 Jett Team. All rights reserved.