@java.lang.SuppressWarnings(value: AbstractClassWithoutAbstractMethod) abstract class AbstractSourceCode extends java.lang.Object implements SourceCode
Abstract superclass for SourceCode implementations
Type | Name and description |
---|---|
static org.slf4j.Logger |
LOG |
static java.lang.String |
SEPARATOR_PROP |
SuppressionAnalyzer |
suppressionAnalyzer |
Constructor and description |
---|
AbstractSourceCode
() |
Type Params | Return Type | Name and description |
---|---|---|
|
ModuleNode |
getAst() Return the Groovy AST (Abstract Syntax Tree) for this source file |
|
int |
getAstCompilerPhase()
|
|
int |
getLineNumberForCharacterIndex(int charIndex) Return the line index for the line containing the character at the specified index within the source code. |
|
java.util.List |
getLines()
|
|
java.util.Map<ClassNode, java.util.List<MethodCallExpression>> |
getMethodCallExpressions() |
|
boolean |
isValid() Return true if and only if the source code can be successfully compiled |
|
java.lang.String |
line(int lineNumber) Get the trimmed line at the specified index |
|
protected java.lang.String |
normalizePath(java.lang.String path) Return the normalized value of the specified path. |
|
protected void |
setSuppressionAnalyzer(SuppressionAnalyzer suppressionAnalyzer) Setter exists to avoid circular dependency. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Return the Groovy AST (Abstract Syntax Tree) for this source file
Return the line index for the line containing the character at the specified index within the source code.
charIndex
- - the index of the character within the source code (zero-based)
Return true if and only if the source code can be successfully compiled
Get the trimmed line at the specified index
lineNumber
- - the zero-based line number; may be negativeReturn the normalized value of the specified path. Convert file separator chars to standard '/'.
path
- - the path to normalizeSetter exists to avoid circular dependency.
suppressionAnalyzer
- suppression analyzerGroovy Documentation