|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.caja.lexer.AbstractTokenStream<HtmlTokenType> com.google.caja.lexer.HtmlInputSplitter
final class HtmlInputSplitter
A token stream that breaks a character stream into HtmlTokenType.{TEXT,TAGBEGIN,TAGEND,DIRECTIVE,COMMENT,CDATA,DIRECTIVE} tokens. The matching of attribute names and values is done in a later step.
Nested Class Summary | |
---|---|
private static class |
HtmlInputSplitter.State
States for a state machine for optimistically identifying tags and other html/xml/phpish structures. |
Field Summary | |
---|---|
private boolean |
asXml
Should the input be considered xml? are escape exempt blocks allowed? |
private java.lang.String |
escapeExemptTagName
Null or the name of the close tag required to end the current escape exempt block. |
private boolean |
inEscapeExemptBlock
True if inside a script, xmp, listing, or similar tag whose content does not follow the normal escaping rules. |
private boolean |
inTag
True iff the current character is inside a tag. |
private java.lang.String |
lastNonIgnorable
|
private CharProducer |
p
The source of HTML character data. |
private HtmlTextEscapingMode |
textEscapingMode
|
Constructor Summary | |
---|---|
HtmlInputSplitter(CharProducer p)
|
Method Summary | ||
---|---|---|
boolean |
getTreatedAsXml()
True iff this is treated as xml. |
|
private boolean |
isIdentStart(char ch)
|
|
private java.lang.String |
name(int start,
int end)
|
|
protected java.lang.String |
name(java.lang.String tagName)
|
|
private Token<HtmlTokenType> |
parseToken()
Breaks the character stream into tokens. |
|
protected Token<HtmlTokenType> |
produce()
Make sure that there is a token ready to yield in this.token. |
|
(package private) static
|
reclassify(Token<T> token,
T type)
|
|
void |
setTreatedAsXml(boolean asXml)
|
Methods inherited from class com.google.caja.lexer.AbstractTokenStream |
---|
hasNext, next |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean asXml
private final CharProducer p
private boolean inTag
private boolean inEscapeExemptBlock
private java.lang.String escapeExemptTagName
private HtmlTextEscapingMode textEscapingMode
private java.lang.String lastNonIgnorable
Constructor Detail |
---|
public HtmlInputSplitter(CharProducer p)
Method Detail |
---|
public boolean getTreatedAsXml()
public void setTreatedAsXml(boolean asXml)
getTreatedAsXml()
protected Token<HtmlTokenType> produce()
produce
in class AbstractTokenStream<HtmlTokenType>
private Token<HtmlTokenType> parseToken()
This property is useful as it allows fetch to collapse and reclassify ranges of tokens based on state that is easy to maintain there.
Later passes are responsible for throwing away useless tokens.
protected java.lang.String name(java.lang.String tagName)
private java.lang.String name(int start, int end)
private boolean isIdentStart(char ch)
static <T extends TokenType> Token<T> reclassify(Token<T> token, T type)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |