Package: groovy.org.codenarc.source

## [Groovy] Class SourceString

- groovy.org.codenarc.source.SourceString

- SourceCode implementation that uses source from a pre-defined String. Note that the path is normalized: file separator chars are normalized to standard '/'.

  Authors:
    Chris Mair

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `String` | `name`
    `String` | `path`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `SourceString (String source, String path = null, String name = null)` Construct a new instance for the file at the specified path

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `String` | `getText()` @return the full text of the source code
    `` | `void` | `setPath(String path)`
    `` | `String` | `toString()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractSourceCode` | `getAst, getAstCompilerPhase, getLineNumberForCharacterIndex, getLines, getMethodCallExpressions, isValid, line, normalizePath, setSuppressionAnalyzer`

- - ### Property Detail

    - #### String name

    - #### String path

  - ### Constructor Detail

    - #### SourceString(String source, String path = null, String name = null)

      Construct a new instance for the file at the specified path

      Parameters:
        `source` - - the source; must not be null or empty
        `path` - - the path for the source code; may be null; defaults to null
        `name` - - the name for the source code; may be null; defaults to null

  - ### Method Detail

    - #### String getText()

      Returns:
        the full text of the source code

    - #### void setPath(String path)

    - #### String toString()