SourceCode implementation that uses source from a pre-defined String. Note that the path is normalized: file separator chars are normalized to standard '/'.
Constructor and description |
---|
SourceString
(String source, String path = null, String name = null) Construct a new instance for the file at the specified path |
Methods inherited from class | Name |
---|---|
class AbstractSourceCode |
createSourceUnit, getAst, getLineNumberForCharacterIndex, getLines, isValid, line, normalizePath |
Construct a new instance for the file at the specified path
source
- - the source; must not be null or emptypath
- - the path for the source code; may be null; defaults to nullname
- - the name for the source code; may be null; defaults to nullGroovy Documentation