org.mozilla.javascript.tools
Class ToolErrorReporter

java.lang.Object
  extended by org.mozilla.javascript.tools.ToolErrorReporter
All Implemented Interfaces:
net.sourceforge.htmlunit.corejs.javascript.ErrorReporter

public class ToolErrorReporter
extends java.lang.Object
implements net.sourceforge.htmlunit.corejs.javascript.ErrorReporter

Error reporter for tools. Currently used by both the shell and the compiler.


Constructor Summary
ToolErrorReporter(boolean reportWarnings)
           
ToolErrorReporter(boolean reportWarnings, java.io.PrintStream err)
           
 
Method Summary
 void error(java.lang.String message, java.lang.String sourceName, int line, java.lang.String lineSource, int lineOffset)
           
static java.lang.String getMessage(java.lang.String messageId)
          Look up the message corresponding to messageId in the org.mozilla.javascript.tools.shell.resources.Messages property file.
static java.lang.String getMessage(java.lang.String messageId, java.lang.Object[] args)
           
static java.lang.String getMessage(java.lang.String messageId, java.lang.Object arg1, java.lang.Object arg2)
           
static java.lang.String getMessage(java.lang.String messageId, java.lang.String argument)
           
 boolean hasReportedError()
           
 boolean isReportingWarnings()
           
static void reportException(net.sourceforge.htmlunit.corejs.javascript.ErrorReporter er, net.sourceforge.htmlunit.corejs.javascript.RhinoException ex)
           
 void reportException(net.sourceforge.htmlunit.corejs.javascript.RhinoException ex)
           
 net.sourceforge.htmlunit.corejs.javascript.EvaluatorException runtimeError(java.lang.String message, java.lang.String sourceName, int line, java.lang.String lineSource, int lineOffset)
           
 void setIsReportingWarnings(boolean reportWarnings)
           
 void warning(java.lang.String message, java.lang.String sourceName, int line, java.lang.String lineSource, int lineOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolErrorReporter

public ToolErrorReporter(boolean reportWarnings)

ToolErrorReporter

public ToolErrorReporter(boolean reportWarnings,
                         java.io.PrintStream err)
Method Detail

getMessage

public static java.lang.String getMessage(java.lang.String messageId)
Look up the message corresponding to messageId in the org.mozilla.javascript.tools.shell.resources.Messages property file. For internationalization support.


getMessage

public static java.lang.String getMessage(java.lang.String messageId,
                                          java.lang.String argument)

getMessage

public static java.lang.String getMessage(java.lang.String messageId,
                                          java.lang.Object arg1,
                                          java.lang.Object arg2)

getMessage

public static java.lang.String getMessage(java.lang.String messageId,
                                          java.lang.Object[] args)

warning

public void warning(java.lang.String message,
                    java.lang.String sourceName,
                    int line,
                    java.lang.String lineSource,
                    int lineOffset)
Specified by:
warning in interface net.sourceforge.htmlunit.corejs.javascript.ErrorReporter

error

public void error(java.lang.String message,
                  java.lang.String sourceName,
                  int line,
                  java.lang.String lineSource,
                  int lineOffset)
Specified by:
error in interface net.sourceforge.htmlunit.corejs.javascript.ErrorReporter

runtimeError

public net.sourceforge.htmlunit.corejs.javascript.EvaluatorException runtimeError(java.lang.String message,
                                                                                  java.lang.String sourceName,
                                                                                  int line,
                                                                                  java.lang.String lineSource,
                                                                                  int lineOffset)
Specified by:
runtimeError in interface net.sourceforge.htmlunit.corejs.javascript.ErrorReporter

hasReportedError

public boolean hasReportedError()

isReportingWarnings

public boolean isReportingWarnings()

setIsReportingWarnings

public void setIsReportingWarnings(boolean reportWarnings)

reportException

public static void reportException(net.sourceforge.htmlunit.corejs.javascript.ErrorReporter er,
                                   net.sourceforge.htmlunit.corejs.javascript.RhinoException ex)

reportException

public void reportException(net.sourceforge.htmlunit.corejs.javascript.RhinoException ex)


Copyright © 2010. All Rights Reserved.