Class DefaultHighlighting
- java.lang.Object
-
- org.sonar.api.batch.sensor.internal.DefaultStorable
-
- org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting
-
- All Implemented Interfaces:
NewHighlighting
public class DefaultHighlighting extends DefaultStorable implements NewHighlighting
-
-
Field Summary
-
Fields inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
storage
-
-
Constructor Summary
Constructors Constructor Description DefaultHighlighting(SensorStorage storage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doSave()
java.util.List<SyntaxHighlightingRule>
getSyntaxHighlightingRuleSet()
DefaultHighlighting
highlight(int startLine, int startLineOffset, int endLine, int endLineOffset, TypeOfText typeOfText)
Shortcut to avoid callingInputFile.newRange(int, int, int, int)
DefaultHighlighting
highlight(int startOffset, int endOffset, TypeOfText typeOfText)
Call this method to indicate the type of text in a range.DefaultHighlighting
highlight(TextRange range, TypeOfText typeOfText)
Call this method to indicate the type of text in a range.InputFile
inputFile()
DefaultHighlighting
onFile(InputFile inputFile)
The file the highlighting 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.highlighting.NewHighlighting
save
-
-
-
-
Constructor Detail
-
DefaultHighlighting
public DefaultHighlighting(SensorStorage storage)
-
-
Method Detail
-
getSyntaxHighlightingRuleSet
public java.util.List<SyntaxHighlightingRule> getSyntaxHighlightingRuleSet()
-
onFile
public DefaultHighlighting onFile(InputFile inputFile)
Description copied from interface:NewHighlighting
The file the highlighting belongs to.- Specified by:
onFile
in interfaceNewHighlighting
-
inputFile
public InputFile inputFile()
-
highlight
public DefaultHighlighting highlight(int startOffset, int endOffset, TypeOfText typeOfText)
Description copied from interface:NewHighlighting
Call this method to indicate the type of text in a range.- Specified by:
highlight
in interfaceNewHighlighting
- Parameters:
startOffset
- Starting position in file for this type of text. Beginning of a file starts with offset '0'.endOffset
- End position in file for this type of text.typeOfText
- seeTypeOfText
values.
-
highlight
public DefaultHighlighting highlight(int startLine, int startLineOffset, int endLine, int endLineOffset, TypeOfText typeOfText)
Description copied from interface:NewHighlighting
Shortcut to avoid callingInputFile.newRange(int, int, int, int)
- Specified by:
highlight
in interfaceNewHighlighting
typeOfText
- seeTypeOfText
values.
-
highlight
public DefaultHighlighting highlight(TextRange range, TypeOfText typeOfText)
Description copied from interface:NewHighlighting
Call this method to indicate the type of text in a range.- Specified by:
highlight
in interfaceNewHighlighting
- Parameters:
range
- Range of text to highlight. See for exampleInputFile.newRange(int, int, int, int)
.typeOfText
- seeTypeOfText
values.
-
doSave
protected void doSave()
- Specified by:
doSave
in classDefaultStorable
-
-