|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.Objectus.codecraft.xsoup.XTokenQueue
public class XTokenQueue
A character queue with parsing helpers.
Most code borrowed fromorg.jsoup.parser.TokenQueue
org.jsoup.parser.TokenQueue| 构造方法摘要 | |
|---|---|
XTokenQueue(String data)
Create a new TokenQueue. |
|
| 方法摘要 | |
|---|---|
void |
addFirst(Character c)
Add a character to the start of the queue (will be the next character retrieved). |
void |
addFirst(String seq)
Add a string to the start of the queue. |
void |
advance()
Drops the next character off the queue. |
String |
chompBalanced(char open,
char close)
Pulls a balanced string off the queue. |
String |
chompBalancedQuotes()
|
String |
chompTo(String seq)
Pulls a string off the queue (like consumeTo), and then pulls off the matched string (but does not return it). |
String |
chompToIgnoreCase(String seq)
|
char |
consume()
Consume one character off queue. |
void |
consume(String seq)
Consumes the supplied sequence of the queue. |
String |
consumeAny(String... seq)
|
String |
consumeAttributeKey()
Consume an attribute key off the queue (letter, digit, -, _, :") |
String |
consumeCssIdentifier()
Consume a CSS identifier (ID or class) off the queue (letter, digit, -, _) http://www.w3.org/TR/CSS2/syndata.html#value-def-identifier |
String |
consumeElementSelector()
Consume a CSS element selector (tag name, but | instead of : for namespaces, to not conflict with :pseudo selects). |
String |
consumeTagName()
Consume an tag name off the queue (word or :, _, -) |
String |
consumeTo(String seq)
Pulls a string off the queue, up to but exclusive of the match sequence, or to the queue running out. |
String |
consumeToAny(String... seq)
Consumes to the first sequence provided, or to the end of the queue. |
String |
consumeToIgnoreCase(String seq)
|
String |
consumeToUnescaped(String str)
|
boolean |
consumeWhitespace()
Pulls the next run of whitespace characters of the queue. |
String |
consumeWord()
Retrieves the next run of word type (letter or digit) off the queue. |
boolean |
containsAny(String... seq)
|
boolean |
isEmpty()
Is the queue empty? |
boolean |
matchChomp(String seq)
Tests if the queue matches the sequence (as with match), and if they do, removes the matched string from the queue. |
boolean |
matches(String seq)
Tests if the next characters on the queue match the sequence. |
boolean |
matchesAny(char... seq)
|
boolean |
matchesAny(String... seq)
Tests if the next characters match any of the sequences. |
boolean |
matchesCS(String seq)
Case sensitive match test. |
boolean |
matchesRegex(String seq)
|
boolean |
matchesStartTag()
|
boolean |
matchesWhitespace()
Tests if queue starts with a whitespace character. |
boolean |
matchesWord()
Test if the queue matches a word character (letter or digit). |
List<String> |
parseFuncionParams()
|
static List<String> |
parseFuncionParams(String paramStr)
|
char |
peek()
Retrieves but does not remove the first character from the queue. |
String |
remainder()
Consume and return whatever is left on the queue. |
String |
toString()
|
static List<String> |
trimQuotes(List<String> strs)
|
static String |
trimQuotes(String str)
|
void |
unConsume(int length)
|
void |
unConsume(String word)
|
static String |
unescape(String in)
Unescaped a \ escaped string. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
public XTokenQueue(String data)
data - string of data to back queue.| 方法详细信息 |
|---|
public boolean isEmpty()
public char peek()
public void addFirst(Character c)
c - character to addpublic void addFirst(String seq)
seq - string to add.public boolean matches(String seq)
seq - String to check queue for.
public boolean matchesRegex(String seq)
public boolean matchesCS(String seq)
seq - string to case sensitively check for
public boolean matchesAny(String... seq)
seq - list of strings to case insensitively check for
public boolean matchesAny(char... seq)
public boolean matchesStartTag()
public boolean matchChomp(String seq)
seq - String to search for, and if found, remove from queue.
public boolean matchesWhitespace()
public boolean matchesWord()
public void advance()
public char consume()
public void consume(String seq)
seq - sequence to remove from head of queue.public String consumeTo(String seq)
seq - String to end on (and not include in return, but leave on queue). Case sensitive.
public String consumeToIgnoreCase(String seq)
public String consumeToAny(String... seq)
seq - any number of terminators to consume to. Case insensitive.
public String consumeAny(String... seq)
public String chompTo(String seq)
seq - String to match up to, and not include in return, and to pull off queue. Case sensitive.
public String chompToIgnoreCase(String seq)
public String chompBalancedQuotes()
public String chompBalanced(char open,
char close)
open - openerclose - closer
public static String unescape(String in)
in - backslash escaped string
public boolean consumeWhitespace()
public String consumeWord()
public String consumeTagName()
public String consumeElementSelector()
public void unConsume(int length)
public void unConsume(String word)
public String consumeCssIdentifier()
public String consumeAttributeKey()
public String remainder()
public String toString()
Object 中的 toStringpublic boolean containsAny(String... seq)
public static String trimQuotes(String str)
public static List<String> trimQuotes(List<String> strs)
public String consumeToUnescaped(String str)
public List<String> parseFuncionParams()
public static List<String> parseFuncionParams(String paramStr)
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||