java.lang.Object | |
↳ | org.jsoup.parser.TokenQueue |
A character queue with parsing helpers.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new TokenQueue.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a string to the start of the queue.
| |||||||||||
Add a character to the start of the queue (will be the next character retrieved).
| |||||||||||
Drops the next character off the queue.
| |||||||||||
Pulls a balanced string off the queue.
| |||||||||||
Pulls a string off the queue (like consumeTo), and then pulls off the matched string (but does not return it).
| |||||||||||
Consumes the supplied sequence of the queue.
| |||||||||||
Consume one character off queue.
| |||||||||||
Consume an attribute key off the queue (letter, digit, -, _, :")
| |||||||||||
Consume a CSS identifier (ID or class) off the queue (letter, digit, -, _)
http://www.w3.org/TR/CSS2/syndata.html#value-def-identifier
| |||||||||||
Consume a CSS element selector (tag name, but | instead of : for namespaces, to not conflict with :pseudo selects).
| |||||||||||
Consume an tag name off the queue (word or :, _, -)
| |||||||||||
Pulls a string off the queue, up to but exclusive of the match sequence, or to the queue running out.
| |||||||||||
Consumes to the first sequence provided, or to the end of the queue.
| |||||||||||
Pulls the next run of whitespace characters of the queue.
| |||||||||||
Retrieves the next run of word type (letter or digit) off the queue.
| |||||||||||
Is the queue empty?
| |||||||||||
Tests if the queue matches the sequence (as with match), and if they do, removes the matched string from the
queue.
| |||||||||||
Tests if the next characters on the queue match the sequence.
| |||||||||||
Tests if the next characters match any of the sequences.
| |||||||||||
Case sensitive match test.
| |||||||||||
Tests if queue starts with a whitespace character.
| |||||||||||
Test if the queue matches a word character (letter or digit).
| |||||||||||
Retrieves but does not remove the first character from the queue.
| |||||||||||
Consume and return whatever is left on the queue.
| |||||||||||
Unescaped a \ escaped string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new TokenQueue.
data | string of data to back queue. |
---|
Add a string to the start of the queue.
seq | string to add. |
---|
Add a character to the start of the queue (will be the next character retrieved).
c | character to add |
---|
Drops the next character off the queue.
Pulls a balanced string off the queue. E.g. if queue is "(one (two) three) four", (,) will return "one (two) three", and leave " four" on the queue. Unbalanced openers and closers can be escaped (with \). Those escapes will be left in the returned string, which is suitable for regexes (where we need to preserve the escape), but unsuitable for contains text strings; use unescape for that.
open | opener |
---|---|
close | closer |
Pulls a string off the queue (like consumeTo), and then pulls off the matched string (but does not return it).
If the queue runs out of characters before finding the seq, will return as much as it can (and queue will go isEmpty() == true).
seq | String to match up to, and not include in return, and to pull off queue. Case sensitive. |
---|
Consumes the supplied sequence of the queue. If the queue does not start with the supplied sequence, will throw an illegal state exception -- but you should be running match() against that condition.
Case insensitive.
seq | sequence to remove from head of queue. |
---|
Consume one character off queue.
Consume an attribute key off the queue (letter, digit, -, _, :")
Consume a CSS identifier (ID or class) off the queue (letter, digit, -, _) http://www.w3.org/TR/CSS2/syndata.html#value-def-identifier
Consume a CSS element selector (tag name, but | instead of : for namespaces, to not conflict with :pseudo selects).
Consume an tag name off the queue (word or :, _, -)
Pulls a string off the queue, up to but exclusive of the match sequence, or to the queue running out.
seq | String to end on (and not include in return, but leave on queue). Case sensitive. |
---|
Consumes to the first sequence provided, or to the end of the queue. Leaves the terminator on the queue.
seq | any number of terminators to consume to. Case insensitive. |
---|
Pulls the next run of whitespace characters of the queue.
Retrieves the next run of word type (letter or digit) off the queue.
Is the queue empty?
Tests if the queue matches the sequence (as with match), and if they do, removes the matched string from the queue.
seq | String to search for, and if found, remove from queue. |
---|
Tests if the next characters on the queue match the sequence. Case insensitive.
seq | String to check queue for. |
---|
Tests if the next characters match any of the sequences. Case insensitive.
Tests if queue starts with a whitespace character.
Test if the queue matches a word character (letter or digit).
Retrieves but does not remove the first character from the queue.
Consume and return whatever is left on the queue.
Unescaped a \ escaped string.
in | backslash escaped string |
---|