public class DefaultJavadocScanner extends Object implements JavadocScanner
JavadocScanner
.Constructor and Description |
---|
DefaultJavadocScanner(List<JavadocToken> tokens,
int successorStartsAt)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
consume(int count)
Consumes the tokens.
|
int |
getIndex()
Returns
the next token index. |
List<JavadocToken> |
getTokens()
Returns the tokens.
|
JavadocToken |
lookahead(int offset)
Looks ahead the token after the offset.
|
static DefaultJavadocScanner |
newInstance(String text)
Creates a new instance from the documentation comment string.
|
JavadocToken |
nextToken()
Consumes the next token and returns it.
|
void |
seek(int position)
Sets the index of the current scanner position.
|
String |
toString() |
public DefaultJavadocScanner(List<JavadocToken> tokens, int successorStartsAt)
tokens
- the tokenssuccessorStartsAt
- the character position of the successive EOF tokenpublic static DefaultJavadocScanner newInstance(String text)
text
- the target textIllegalArgumentException
- if the parameter is null
public List<JavadocToken> getTokens()
JavadocScanner
getTokens
in interface JavadocScanner
public int getIndex()
JavadocScanner
the next token
index.getIndex
in interface JavadocScanner
public void seek(int position)
JavadocScanner
seek
in interface JavadocScanner
position
- the index which indicates the next token
public void consume(int count)
JavadocScanner
consume
in interface JavadocScanner
count
- the number of tokens to be consumedpublic JavadocToken nextToken()
JavadocScanner
nextToken
in interface JavadocScanner
public JavadocToken lookahead(int offset)
JavadocScanner
0
.lookahead
in interface JavadocScanner
offset
- the token offsetCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.