org.jppf.scripting
Class RhinoScriptRunner.ErrorHandler

java.lang.Object
  extended by org.jppf.scripting.RhinoScriptRunner.ErrorHandler
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter
Enclosing class:
RhinoScriptRunner

public static class RhinoScriptRunner.ErrorHandler
extends Object
implements org.mozilla.javascript.ErrorReporter

Error handler for this script runner.


Field Summary
 List<String> errors
          Errors thrown during execution or translation of a script.
 
Constructor Summary
RhinoScriptRunner.ErrorHandler()
           
 
Method Summary
 void error(String message, String sourceName, int line, String lineSource, int lineOffset)
          Report an error.
 org.mozilla.javascript.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
          Creates an EvaluatorException that may be thrown.
 void warning(String message, String sourceName, int line, String lineSource, int lineOffset)
          Report a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errors

public List<String> errors
Errors thrown during execution or translation of a script.

Constructor Detail

RhinoScriptRunner.ErrorHandler

public RhinoScriptRunner.ErrorHandler()
Method Detail

error

public void error(String message,
                  String sourceName,
                  int line,
                  String lineSource,
                  int lineOffset)
Report an error. If execution has not yet begun, the JavaScript engine is free to find additional errors rather than terminating the translation. It will not execute a script that had errors, however.

Specified by:
error in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - a String describing the error
sourceName - a String describing the JavaScript source where the error occured; typically a filename or URL
line - the line number associated with the error
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
See Also:
ErrorReporter.error(java.lang.String, java.lang.String, int, java.lang.String, int)

warning

public void warning(String message,
                    String sourceName,
                    int line,
                    String lineSource,
                    int lineOffset)
Report a warning.

Specified by:
warning in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - a String describing the warning
sourceName - a String describing the JavaScript source where the warning occured; typically a filename or URL
line - the line number associated with the warning
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
See Also:
ErrorReporter.warning(java.lang.String, java.lang.String, int, java.lang.String, int)

runtimeError

public org.mozilla.javascript.EvaluatorException runtimeError(String message,
                                                              String sourceName,
                                                              int line,
                                                              String lineSource,
                                                              int lineOffset)
Creates an EvaluatorException that may be thrown. runtimeErrors, unlike errors, will always terminate the current script.

Specified by:
runtimeError in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - a String describing the error
sourceName - a String describing the JavaScript source where the error occured; typically a filename or URL
line - the line number associated with the error
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
Returns:
an EvaluatorException that will be thrown.
See Also:
ErrorReporter.runtimeError(java.lang.String, java.lang.String, int, java.lang.String, int)


Copyright © 2005-2010 JPPF Team.