Package com.google.javascript.jscomp
Interface SourceExcerptProvider
-
- All Known Implementing Classes:
AbstractCompiler,Compiler,SimpleSourceExcerptProvider
public interface SourceExcerptProviderA source excerpt provider is responsible for building source code excerpt of specific locations, such as a specific line or a region around a given line number.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSourceExcerptProvider.ExcerptFormatterA excerpt formatter is responsible of formatting source excerpts.static classSourceExcerptProvider.SourceExcerptSource excerpt variety.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetSourceLine(java.lang.String sourceName, int lineNumber)Get the line indicated by the line number.RegiongetSourceRegion(java.lang.String sourceName, int lineNumber)Get a region around the indicated line number.
-
-
-
Method Detail
-
getSourceLine
java.lang.String getSourceLine(java.lang.String sourceName, int lineNumber)Get the line indicated by the line number. This call will return only the specific line.- Parameters:
lineNumber- the line number, 1 being the first line of the file- Returns:
- the line indicated, or
nullif it does not exist
-
getSourceRegion
Region getSourceRegion(java.lang.String sourceName, int lineNumber)
Get a region around the indicated line number. The exact definition of a region is implementation specific, but it must contain the line indicated by the line number. A region must not start or end by a carriage return.- Parameters:
lineNumber- the line number, 1 being the first line of the file- Returns:
- the region around the line number indicated, or
null if it does not exist
-
-