public class DefaultCpdTokens extends DefaultStorable implements NewCpdTokens
storage
Constructor and Description |
---|
DefaultCpdTokens(Configuration config,
SensorStorage storage) |
Modifier and Type | Method and Description |
---|---|
NewCpdTokens |
addToken(int startLine,
int startLineOffset,
int endLine,
int endLineOffset,
String image)
Shortcut to avoid calling
InputFile.newRange(int, int, int, int) |
DefaultCpdTokens |
addToken(TextRange range,
String image)
Call this method to register a token in a range.
|
protected void |
doSave() |
List<TokensLine> |
getTokenLines() |
InputFile |
inputFile() |
DefaultCpdTokens |
onFile(InputFile inputFile)
The tokenized file.
|
save, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
save
public DefaultCpdTokens(Configuration config, SensorStorage storage)
public DefaultCpdTokens onFile(InputFile inputFile)
NewCpdTokens
onFile
in interface NewCpdTokens
public NewCpdTokens addToken(int startLine, int startLineOffset, int endLine, int endLineOffset, String image)
NewCpdTokens
InputFile.newRange(int, int, int, int)
addToken
in interface NewCpdTokens
public DefaultCpdTokens addToken(TextRange range, String image)
NewCpdTokens
addToken
in interface NewCpdTokens
range
- Token position. Use InputFile.newRange(int, int, int, int)
to get a valid range.image
- Text content of the token. Can be replaced by a constant placeholder for some tokens (like litterals).public List<TokensLine> getTokenLines()
protected void doSave()
doSave
in class DefaultStorable
Copyright © 2009–2017 SonarSource. All rights reserved.