com.gargoylesoftware.htmlunit.javascript
Class StrictErrorReporter

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter

public class StrictErrorReporter
extends java.lang.Object
implements org.mozilla.javascript.ErrorReporter

A javascript error reporter that will log all warnings and errors, no matter how trivial.

Version:
$Revision: 1.3 $
Author:
Mike Bowler

Constructor Summary
StrictErrorReporter(org.apache.commons.logging.Log log)
 Create an instance.
 
Method Summary
 void error(java.lang.String message, java.lang.String sourceName, int line, java.lang.String lineSource, int lineOffset)
 Log an error
 org.mozilla.javascript.EvaluatorException runtimeError(java.lang.String message, java.lang.String sourceName, int line, java.lang.String lineSource, int lineOffset)
 Log a runtime error
 void warning(java.lang.String message, java.lang.String sourceName, int line, java.lang.String lineSource, int lineOffset)
 Log a warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrictErrorReporter

public StrictErrorReporter(org.apache.commons.logging.Log log)
Create an instance.

Parameters:
log - The log to use when reporting errors
Method Detail

error

public void error(java.lang.String message,
                  java.lang.String sourceName,
                  int line,
                  java.lang.String lineSource,
                  int lineOffset)
Log an error

Specified by:
error in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - The message to be displayed.
sourceName - The name of the source file
line - The line number
lineSource - The source code that failed
lineOffset - The line offset

runtimeError

public org.mozilla.javascript.EvaluatorException runtimeError(java.lang.String message,
                                                              java.lang.String sourceName,
                                                              int line,
                                                              java.lang.String lineSource,
                                                              int lineOffset)
Log a runtime error

Specified by:
runtimeError in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - The message to be displayed.
sourceName - The name of the source file
line - The line number
lineSource - The source code that failed
lineOffset - The line offset
Returns:
An evaluator exception

warning

public void warning(java.lang.String message,
                    java.lang.String sourceName,
                    int line,
                    java.lang.String lineSource,
                    int lineOffset)
Log a warning

Specified by:
warning in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - The message to be displayed.
sourceName - The name of the source file
line - The line number
lineSource - The source code that failed
lineOffset - The line offset


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.