Groovy Documentation

org.gmetrics.source
[Groovy] Class SourceString

java.lang.Object
  org.gmetrics.source.AbstractSourceCode
      org.gmetrics.source.SourceString

class SourceString
extends AbstractSourceCode

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
Version:
\$Revision: 29 \$ - \$Date: 2009-12-13 15:50:29 -0500 (Sun, 13 Dec 2009) \$


Property Summary
String name

String path

 
Constructor Summary
SourceString(String source, String path = null, String name = null)

Construct a new instance for the file at the specified path

 
Method Summary
protected def createSourceUnit()

String getText()

@return the full text of the source code

void setPath(String path)

String toString()

 
Methods inherited from class AbstractSourceCode
createSourceUnit, getAst, getLineNumberForCharacterIndex, getLines, line, normalizePath
 

Property Detail

name

String name


path

String path


 
Constructor Detail

SourceString

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

createSourceUnit

protected def createSourceUnit()


getText

String getText()
Returns:
the full text of the source code


setPath

void setPath(String path)


toString

String toString()


 

Groovy Documentation