org.kuali.rice.krad.theme.util
Class JavaScriptErrorReporter

java.lang.Object
  extended by org.kuali.rice.krad.theme.util.JavaScriptErrorReporter
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter

public class JavaScriptErrorReporter
extends Object
implements org.mozilla.javascript.ErrorReporter

Reports any error occurring during JavaScript files compression

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
JavaScriptErrorReporter(String filename)
          Error reporter constructor
 
Method Summary
 void error(String message, String sourceName, int line, String lineSource, int lineOffset)
          Reports 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)
          Reports a warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptErrorReporter

public JavaScriptErrorReporter(String filename)
Error reporter constructor

Parameters:
filename - JavaScript source filename
Method Detail

warning

public void warning(String message,
                    String sourceName,
                    int line,
                    String lineSource,
                    int lineOffset)
Reports 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

error

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

Specified by:
error 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

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 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


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.