org.apache.cocoon.components.flow.javascript
Class LocationTrackingDebugger

java.lang.Object
  extended byorg.apache.cocoon.components.flow.javascript.LocationTrackingDebugger
All Implemented Interfaces:
org.mozilla.javascript.debug.Debugger

public class LocationTrackingDebugger
extends Object
implements org.mozilla.javascript.debug.Debugger

A Rhino debugger that tracks location information when an exception is raised in some JavaScript code. It's purpose is to build a ProcessingException that holds the stacktrace in the JavaScript code.

This debugger implementation is designed to be as lightweight and fast as possible, in order to have a negligible impact on the performances of the Rhino interpreter.

Since:
2.1.8
Version:
$Id: LocationTrackingDebugger.java 280811 2005-09-14 09:53:32Z sylvain $

Constructor Summary
LocationTrackingDebugger()
           
 
Method Summary
 Exception getException(String description, Exception originalException)
          Get an exception that reflects the known location stack
 org.mozilla.javascript.debug.DebugFrame getFrame(org.mozilla.javascript.Context cx, org.mozilla.javascript.debug.DebuggableScript fnOrScript)
           
 void handleCompilationDone(org.mozilla.javascript.Context cx, org.mozilla.javascript.debug.DebuggableScript fnOrScript, String source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationTrackingDebugger

public LocationTrackingDebugger()
Method Detail

handleCompilationDone

public void handleCompilationDone(org.mozilla.javascript.Context cx,
                                  org.mozilla.javascript.debug.DebuggableScript fnOrScript,
                                  String source)
Specified by:
handleCompilationDone in interface org.mozilla.javascript.debug.Debugger

getFrame

public org.mozilla.javascript.debug.DebugFrame getFrame(org.mozilla.javascript.Context cx,
                                                        org.mozilla.javascript.debug.DebuggableScript fnOrScript)
Specified by:
getFrame in interface org.mozilla.javascript.debug.Debugger

getException

public Exception getException(String description,
                              Exception originalException)
                       throws ProcessingException
Get an exception that reflects the known location stack

Parameters:
description - a description for the exception
originalException - the original exception
Returns:
a suitable exception to throw
Throws:
ProcessingException
See Also:
ProcessingException.throwLocated(String, Throwable, Location)


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.