Package org.gmetrics.source
Class AbstractSourceCode
- java.lang.Object
-
- org.gmetrics.source.AbstractSourceCode
-
- All Implemented Interfaces:
groovy.lang.GroovyObject
,SourceCode
- Direct Known Subclasses:
SourceFile
,SourceString
public abstract class AbstractSourceCode extends Object implements SourceCode, groovy.lang.GroovyObject
-
-
Constructor Summary
Constructors Constructor Description AbstractSourceCode()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Object
createSourceUnit()
org.codehaus.groovy.ast.ModuleNode
getAst()
static Object
getFILE_SEPARATOR()
int
getLineNumberForCharacterIndex(int charIndex)
List
getLines()
static Object
getLOG()
groovy.lang.MetaClass
getMetaClass()
Object
getProperty(String property)
Object
invokeMethod(String method, Object arguments)
boolean
isValid()
String
line(int lineNumber)
protected String
normalizePath(String path)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setProperty(String property, Object value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gmetrics.source.SourceCode
getName, getPath, getText
-
-
-
-
Method Detail
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
-
invokeMethod
public Object invokeMethod(String method, Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
public Object getProperty(String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(String property, Object value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
getLOG
public static Object getLOG()
-
getFILE_SEPARATOR
public static Object getFILE_SEPARATOR()
-
createSourceUnit
protected abstract Object createSourceUnit()
-
getLines
public List getLines()
- Specified by:
getLines
in interfaceSourceCode
-
line
public String line(int lineNumber)
- Specified by:
line
in interfaceSourceCode
-
getAst
public org.codehaus.groovy.ast.ModuleNode getAst()
- Specified by:
getAst
in interfaceSourceCode
-
getLineNumberForCharacterIndex
public int getLineNumberForCharacterIndex(int charIndex)
- Specified by:
getLineNumberForCharacterIndex
in interfaceSourceCode
-
isValid
public boolean isValid()
- Specified by:
isValid
in interfaceSourceCode
-
-