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 java.lang.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 java.lang.ObjectcreateSourceUnit()org.codehaus.groovy.ast.ModuleNodegetAst()static java.lang.ObjectgetFILE_SEPARATOR()intgetLineNumberForCharacterIndex(int charIndex)java.util.ListgetLines()static java.lang.ObjectgetLOG()groovy.lang.MetaClassgetMetaClass()java.lang.ObjectgetProperty(java.lang.String property)java.lang.ObjectinvokeMethod(java.lang.String method, java.lang.Object arguments)booleanisValid()java.lang.Stringline(int lineNumber)protected java.lang.StringnormalizePath(java.lang.String path)voidsetMetaClass(groovy.lang.MetaClass mc)voidsetProperty(java.lang.String property, java.lang.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 java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject
-
getLOG
public static java.lang.Object getLOG()
-
getFILE_SEPARATOR
public static java.lang.Object getFILE_SEPARATOR()
-
createSourceUnit
protected abstract java.lang.Object createSourceUnit()
-
getLines
public java.util.List getLines()
- Specified by:
getLinesin interfaceSourceCode
-
line
public java.lang.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
-
normalizePath
protected java.lang.String normalizePath(java.lang.String path)
-
-