|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTokenStream
TokenFilter
TagFilter
public class TagFilter
Spots XML elements in a token stream and marks them specially.
Field Summary | |
---|---|
private String |
attrName
Name of the current attribute |
private int |
attrNameStart
Start position of the attribute name |
private String |
elementName
Name of the last element we've started |
private Token |
elementStart
Start position of insides of element def |
private boolean |
inAttrName
True when we're within an attribute name |
private boolean |
inElement
True while we're processing inside an element definition |
private boolean |
inEndTag
True while we're in an element end tag |
private boolean |
inQuote
True when we're within a quoted attribute value |
private int |
quoteStart
Position of initial quote mark |
private char[] |
srcChars
The source text being tokenized |
static Tester |
tester
Basic regression test |
private LinkedList |
tokenQueue
Queued tokens |
static String |
XML_TYPE
Type of returned 'element' tokens |
Fields inherited from class TokenFilter |
---|
input |
Constructor Summary | |
---|---|
TagFilter(TokenStream input,
String srcText)
Construct a token stream to mark XML elements. |
Method Summary | |
---|---|
Token |
next()
Retrieve the next token in the stream. |
private Token |
processNext(Token curToken)
Does most of the work of processing a token |
Methods inherited from class TokenFilter |
---|
close |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String XML_TYPE
private char[] srcChars
private boolean inElement
private String elementName
private boolean inEndTag
private Token elementStart
private boolean inQuote
private int quoteStart
private boolean inAttrName
private int attrNameStart
private String attrName
private LinkedList tokenQueue
public static final Tester tester
Constructor Detail |
---|
public TagFilter(TokenStream input, String srcText)
input
- Input stream of tokens to processMethod Detail |
---|
public Token next() throws IOException
next
in class TokenStream
IOException
private Token processNext(Token curToken)
curToken
- The token from the input stream
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |