gate.jape
Class SourceInfo

java.lang.Object
  extended by gate.jape.SourceInfo

public class SourceInfo
extends Object

A simple class to store and use the mapping between Java and Jape source code for error reporting.


Constructor Summary
SourceInfo(String className, String phaseName, String sectionName)
           
 
Method Summary
 String addBlock(String previousCode, String codeBlock)
           
 void enhanceTheThrowable(Throwable t)
          Enhances a Throwable by replacing mentions of Java code inside a Jape RhsAction with a reference to the original Jape source where available.
 String getSource(String source, int javaLineNumber)
           
 StackTraceElement getStackTraceElement(int javaLineNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceInfo

public SourceInfo(String className,
                  String phaseName,
                  String sectionName)
Method Detail

addBlock

public String addBlock(String previousCode,
                       String codeBlock)

getSource

public String getSource(String source,
                        int javaLineNumber)

getStackTraceElement

public StackTraceElement getStackTraceElement(int javaLineNumber)

enhanceTheThrowable

public void enhanceTheThrowable(Throwable t)
Enhances a Throwable by replacing mentions of Java code inside a Jape RhsAction with a reference to the original Jape source where available.

Parameters:
t - the Throwable to enhance with Jape source information