Class DefaultSymbolTable
- java.lang.Object
-
- org.sonar.api.batch.sensor.internal.DefaultStorable
-
- org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable
-
- All Implemented Interfaces:
NewSymbolTable
public class DefaultSymbolTable extends DefaultStorable implements NewSymbolTable
-
-
Field Summary
-
Fields inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
storage
-
-
Constructor Summary
Constructors Constructor Description DefaultSymbolTable(SensorStorage storage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doSave()
java.util.Map<TextRange,java.util.Set<TextRange>>
getReferencesBySymbol()
InputFile
inputFile()
NewSymbol
newSymbol(int startOffset, int endOffset)
Register a new symbol declaration.NewSymbol
newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset)
Shortcut to avoid callingInputFile.newRange(int, int, int, int)
NewSymbol
newSymbol(TextRange range)
Register a new symbol declaration.DefaultSymbolTable
onFile(InputFile inputFile)
The file the symbol table belongs to.-
Methods inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
save, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.sonar.api.batch.sensor.symbol.NewSymbolTable
save
-
-
-
-
Constructor Detail
-
DefaultSymbolTable
public DefaultSymbolTable(SensorStorage storage)
-
-
Method Detail
-
getReferencesBySymbol
public java.util.Map<TextRange,java.util.Set<TextRange>> getReferencesBySymbol()
-
onFile
public DefaultSymbolTable onFile(InputFile inputFile)
Description copied from interface:NewSymbolTable
The file the symbol table belongs to.- Specified by:
onFile
in interfaceNewSymbolTable
-
inputFile
public InputFile inputFile()
-
newSymbol
public NewSymbol newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset)
Description copied from interface:NewSymbolTable
Shortcut to avoid callingInputFile.newRange(int, int, int, int)
- Specified by:
newSymbol
in interfaceNewSymbolTable
-
newSymbol
public NewSymbol newSymbol(int startOffset, int endOffset)
Description copied from interface:NewSymbolTable
Register a new symbol declaration.- Specified by:
newSymbol
in interfaceNewSymbolTable
- Parameters:
startOffset
- Starting position in file for the declaration of this symbol. Beginning of a file starts with offset '0'.endOffset
- End position in file for this symbol declaration.
-
newSymbol
public NewSymbol newSymbol(TextRange range)
Description copied from interface:NewSymbolTable
Register a new symbol declaration.- Specified by:
newSymbol
in interfaceNewSymbolTable
- Parameters:
range
- Range of text for the symbol declaration. See for exampleInputFile.newRange(int, int, int, int)
.
-
doSave
protected void doSave()
- Specified by:
doSave
in classDefaultStorable
-
-