interface SourceCode
Represents a unit of source code to be analyzed
Modifiers | Name | Description |
---|---|---|
static int |
DEFAULT_COMPILER_PHASE |
Type Params | Return Type | Name and description |
---|---|---|
|
abstract ModuleNode |
getAst() Return the Groovy AST (Abstract Syntax Tree) for this source file |
|
abstract int |
getAstCompilerPhase()
|
|
abstract int |
getLineNumberForCharacterIndex(int charIndex) Return the line index for the line containing the character at the specified index within the source code. |
|
abstract java.util.List<java.lang.String> |
getLines()
|
|
abstract java.util.Map<ClassNode, java.util.List<MethodCallExpression>> |
getMethodCallExpressions() This method gives you all of the MethodCallExpressions defined in the AST without forcing you to walk the entire tree on every request. |
|
abstract java.lang.String |
getName() Get the logical name for this source code. |
|
abstract java.lang.String |
getPath() Get the logical path for this source code. |
|
abstract SuppressionAnalyzer |
getSuppressionAnalyzer() Returns information about this classes' suppressed warnings. |
|
abstract java.lang.String |
getText()
|
|
abstract boolean |
isValid() Return true if and only if the source code can be successfully compiled |
|
abstract java.lang.String |
line(int lineNumber) Get the trimmed line at the specified index |
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)
This method gives you all of the MethodCallExpressions defined in the AST without forcing you to walk the entire tree on every request. They are cached for the lifespan of the SourceCode.
Get the logical name for this source code. If this object is a file, then the name is the filename, without a path.
Get the logical path for this source code. If this object is a file, then the name is the full path in the filesystem. File separators are normalized to forward slash (/).
Returns information about this classes' suppressed warnings.
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 negative