@java.lang.SuppressWarnings('AbstractClassWithoutAbstractMethod') abstract class AbstractSourceCode extends java.lang.Object
Abstract superclass for SourceCode implementations
Type | Name and description |
---|---|
static org.slf4j.Logger |
LOG |
static java.lang.String |
SEPARATOR_PROP |
SuppressionAnalyzer |
suppressionAnalyzer |
Type Params | Return Type | Name and description |
---|---|---|
|
org.codehaus.groovy.ast.ModuleNode |
getAst() Return the Groovy AST (Abstract Syntax Tree) for this source file |
|
int |
getAstCompilerPhase() @return compiler phase (as in org.codehaus.groovy.control.Phases) up to which the AST will be processed |
|
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() @return the List of lines of the source code (with line terminators removed) |
|
java.util.Map<org.codehaus.groovy.ast.ClassNode, java.util.List<org.codehaus.groovy.ast.expr.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(long), java.lang.Object#wait(), 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 analyzer