org.exolab.adaptx.xslt.util
Class DefaultObserver
java.lang.Object
org.exolab.adaptx.xslt.util.DefaultObserver
- ErrorObserver, MessageObserver
public class DefaultObserver
extends java.lang.Object
A simple implementation of MessageObserver and ErrorObserver.
This observer is cascading, which means you can add observers
to it, and it will cascade notifications.
$Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
DefaultObserver() - Creates a new SimpleMessageObserver which will
print messages to the console.
|
DefaultObserver(Writer writer) - Creates a new SimpleMessageObserver which will
print messages to the console.
|
DefaultObserver(Writer writer, boolean allErrorsFatal) - Creates a new SimpleMessageObserver which will
print messages to the console.
|
DefaultObserver(boolean allErrorsFatal) - Creates a new SimpleMessageObserver which will
print messages to the console.
|
DefaultObserver
public DefaultObserver()
Creates a new SimpleMessageObserver which will
print messages to the console. A fatal error
will cause a RuntimeException.
DefaultObserver
public DefaultObserver(Writer writer)
Creates a new SimpleMessageObserver which will
print messages to the console. A fatal error
will cause a RuntimeException.
writer
- the Writer to print messages to. This
writer may be null, to create a null sink.
DefaultObserver
public DefaultObserver(Writer writer,
boolean allErrorsFatal)
Creates a new SimpleMessageObserver which will
print messages to the console. A fatal error
will cause a RuntimeException.
writer
- the Writer to print messages to. This
writer may be null, to create a null sink.allErrorsFatal
- a boolean, when true will
treat all errors as fatal errors (excludes warnings).
DefaultObserver
public DefaultObserver(boolean allErrorsFatal)
Creates a new SimpleMessageObserver which will
print messages to the console. A fatal error
will cause a RuntimeException.
allErrorsFatal
- a boolean, when true will
treat all errors as fatal errors (excludes warnings).
addErrorObserver
public void addErrorObserver(ErrorObserver observer)
Adds the given ErrorObserver to this DefaultObserver
observer
- the ErrorObserver to add
addMessageObserver
public void addMessageObserver(MessageObserver observer)
Adds the given MessageObserver to this DefaultObserver
observer
- the MessageObserver to add
receiveError
public void receiveError(Exception exception)
Signals an error with normal level
- receiveError in interface ErrorObserver
exception
- the Exception that caused the error
receiveError
public void receiveError(Exception exception,
String message)
Signals an error with normal level
- receiveError in interface ErrorObserver
exception
- the Exception that caused the errormessage
- an option message, used when additional information
can be provided.
receiveError
public void receiveError(Exception exception,
String message,
int level)
Signals an error with the given error level
- receiveError in interface ErrorObserver
exception
- the Exception that caused the errormessage
- an option message, used when additional information
can be provided.level
- the error level
receiveError
public void receiveError(Exception exception,
int level)
Signals an error with the given error level
- receiveError in interface ErrorObserver
exception
- the Exception that caused the errorlevel
- the error level
receiveError
public void receiveError(String message)
Signals an error message with normal level
- receiveError in interface ErrorObserver
message
- the error message
receiveError
public void receiveError(String message,
int level)
Signals an error message with the given error level
- receiveError in interface ErrorObserver
message
- the error messagelevel
- the error level
receiveMessage
public void receiveMessage(String message)
Notifies this observer of a new message
- receiveMessage in interface MessageObserver
message
- the message to observe
removeAllErrorObservers
public void removeAllErrorObservers()
Removes all the ErrorObservers from the cascading
ErrorObserver list
removeAllMessageObservers
public void removeAllMessageObservers()
Removes all the MessageObservers from the cascading
ErrorObserver list
removeErrorObserver
public void removeErrorObserver(ErrorObserver observer)
Removes the given ErrorObserver from the cascading
ErrorObserver list
observer
- the ErrorObserver to remove
removeMessageObserver
public void removeMessageObserver(MessageObserver observer)
Removes the given MessageObserver from the cascading
MessageObserver list
observer
- the MessageObserver to remove
setWriter
public void setWriter(Writer writer)
Sets the Writer of this MessageObserver
writer
- the Writer to print messages to