Package: groovy.org.codenarc.util

## [Groovy] Class SourceCodeUtil

- groovy.org.codenarc.util.SourceCodeUtil

- Contains source related static utility methods

  Authors:
    Marcin Erdmann

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static List<String>` | `nodeSourceLines(SourceCode source, org.codehaus.groovy.ast.ASTNode node)`
    `` | `static List<String>` | `sourceLinesBetween(SourceCode source, int startLine, int startColumn, int endLine, int endColumn)` Retrieves source lines between the start line and column and end line and column.
    `` | `static List<String>` | `sourceLinesBetweenNodes(SourceCode source, org.codehaus.groovy.ast.ASTNode startNode, org.codehaus.groovy.ast.ASTNode endNode)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### static List<String> nodeSourceLines(SourceCode source, org.codehaus.groovy.ast.ASTNode node)

    - #### static List<String> sourceLinesBetween(SourceCode source, int startLine, int startColumn, int endLine, int endColumn)

      Retrieves source lines between the start line and column and end line and column. Lines and columns are counted starting at one as do the lines and columns describing a beginning and end of ASTNode.

      throws:
        IllegalArgumentException when start is not before end, and any of the start/end parameters is lower than one
      Parameters:
        `source` - Source from which the lines are to be extracted
        `startLine` - has to be greater than zero
        `startColumn` - has to be greater than zero
        `endLine` - has to be greater than zero
        `endColumn` - has to be greater than zero
      Returns:
        a List of string containing the extracted code

    - #### static List<String> sourceLinesBetweenNodes(SourceCode source, org.codehaus.groovy.ast.ASTNode startNode, org.codehaus.groovy.ast.ASTNode endNode)