com.japisoft.xmlpad.error
Class ErrorManager

java.lang.Object
  extended bycom.japisoft.xmlpad.error.ErrorManager
All Implemented Interfaces:
ErrorListener

public class ErrorManager
extends java.lang.Object
implements ErrorListener

Here a class for storing/processing errors

Version:
1.0
Author:
(c) 2004 JAPISoft / http://www.japisoft.com

Field Summary
static java.lang.String ON_THE_FLY_PARSING_CONTEXT
           
 
Constructor Summary
ErrorManager()
           
 
Method Summary
 void addErrorListener(ErrorListener listener)
          Add a new listener for onTheFly or full parsing error
 void dispose()
           
 void flushLastError()
          Eliminate any trace of the last error.
 boolean hasLastError()
           
 boolean hasLastErrorOnTheFly()
           
 void initErrorProcessing()
          Inform all the listeners, that some error reporting is beginning
 void notifyError(java.lang.Object context, boolean localError, java.lang.String sourceLocation, int line, int column, int offset, java.lang.String message, boolean onTheFly)
          Inform all the listeners.
 void notifyError(java.lang.String message)
          Here a shortcut for sending a single error message
 void notifyError(java.lang.String message, int line)
          Here a shortcut for sending a single error message at the following line
 void notifyNoError(boolean onTheFly)
          Inform all the listeners
 void notifyUniqueError(boolean localError, java.lang.String sourceLocation, int line, int column, int offset, java.lang.String message, boolean onTheFly)
          Notify only one error.
 void removeErrorListener(ErrorListener listener)
           
 void stopErrorProcessing()
          Inform all the listeners, that no more error reporting will be done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_THE_FLY_PARSING_CONTEXT

public static final java.lang.String ON_THE_FLY_PARSING_CONTEXT
See Also:
Constant Field Values
Constructor Detail

ErrorManager

public ErrorManager()
Method Detail

addErrorListener

public void addErrorListener(ErrorListener listener)
Add a new listener for onTheFly or full parsing error


removeErrorListener

public void removeErrorListener(ErrorListener listener)

initErrorProcessing

public void initErrorProcessing()
Inform all the listeners, that some error reporting is beginning

Specified by:
initErrorProcessing in interface ErrorListener

stopErrorProcessing

public void stopErrorProcessing()
Inform all the listeners, that no more error reporting will be done

Specified by:
stopErrorProcessing in interface ErrorListener

notifyError

public void notifyError(java.lang.String message)
Here a shortcut for sending a single error message


notifyError

public void notifyError(java.lang.String message,
                        int line)
Here a shortcut for sending a single error message at the following line


notifyError

public void notifyError(java.lang.Object context,
                        boolean localError,
                        java.lang.String sourceLocation,
                        int line,
                        int column,
                        int offset,
                        java.lang.String message,
                        boolean onTheFly)
Inform all the listeners. It is possible to have multiple errors. So the errors reporting must be completed by calling the stopErrorProcessing method.

Specified by:
notifyError in interface ErrorListener
Parameters:
context - the error context, it can be null and may be ignored
localError - a flag for knowing if the error is inside the current document (sometimes this is inside a DTD or a W3C Schema)
sourceLocation - The document location
line - The error line
column - The error column
offset - The error offset
message - The error message
onTheFly - Flag for informing if this is while the user inserts or no

notifyUniqueError

public void notifyUniqueError(boolean localError,
                              java.lang.String sourceLocation,
                              int line,
                              int column,
                              int offset,
                              java.lang.String message,
                              boolean onTheFly)
Notify only one error. It will called the stopErrorProcessing method at the end

Parameters:
localError -
sourceLocation -
line -
column -
offset -
message -
onTheFly -

notifyNoError

public void notifyNoError(boolean onTheFly)
Inform all the listeners

Specified by:
notifyNoError in interface ErrorListener
Parameters:
onTheFly - for informing if this is while inserting characters

flushLastError

public void flushLastError()
Eliminate any trace of the last error. Should'nt be called


hasLastError

public boolean hasLastError()
Returns:
true if an error exists

hasLastErrorOnTheFly

public boolean hasLastErrorOnTheFly()
Returns:
true if the last error is due to an onthefly problem

dispose

public void dispose()


Copyright © 2006 JAPISoft. All Rights Reserved.