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 ObjectcreateSourceUnit()org.codehaus.groovy.ast.ModuleNodegetAst()static ObjectgetFILE_SEPARATOR()intgetLineNumberForCharacterIndex(int charIndex)ListgetLines()static ObjectgetLOG()groovy.lang.MetaClassgetMetaClass()ObjectgetProperty(String property)ObjectinvokeMethod(String method, Object arguments)booleanisValid()Stringline(int lineNumber)protected StringnormalizePath(String path)voidsetMetaClass(groovy.lang.MetaClass mc)voidsetProperty(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:
getMetaClassin interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject
-
invokeMethod
public Object invokeMethod(String method, Object arguments)
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject
-
getProperty
public Object getProperty(String property)
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(String property, Object value)
- Specified by:
setPropertyin 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:
getLinesin interfaceSourceCode
-
line
public String line(int lineNumber)
- Specified by:
linein interfaceSourceCode
-
getAst
public org.codehaus.groovy.ast.ModuleNode getAst()
- Specified by:
getAstin interfaceSourceCode
-
getLineNumberForCharacterIndex
public int getLineNumberForCharacterIndex(int charIndex)
- Specified by:
getLineNumberForCharacterIndexin interfaceSourceCode
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceSourceCode
-
-