|
Spatial DataBlade JAVA API v8.21 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ibm.spatial.util.ErrorReporter
public class ErrorReporter
This class contains methods to report errors from inside the API code.
| Field Summary | |
|---|---|
static int |
ERROR
Fatal error |
static int |
EXCEPTION
|
static int |
RECOVERABLE_ERROR
Recoverable error |
static int |
RUNTIME
|
static int |
WARNING
Warning |
| Constructor Summary | |
|---|---|
ErrorReporter()
|
|
ErrorReporter(ErrorHandler handler,
MessageProvider messages,
MessageProvider implementationMessages)
|
|
| Method Summary | |
|---|---|
static java.lang.StringBuffer |
formatEventLocation(java.lang.StringBuffer buf,
EventLocation location,
boolean writeClassInfo)
Append EventLocation info to the message buffer specified by buf. |
static java.lang.String |
formatMessage(int msgCode,
MessageProvider provider,
java.lang.Object[] args,
EventLocation location,
boolean writeClassInfo)
Returns a formatted error message. |
ErrorHandler |
getHandler()
Returns the current error handler. |
boolean |
getWriteClassInfo()
Rerturns the value of the writeClassInfo flag. |
void |
reportError(int errorType,
int msgCode,
java.lang.Object[] args,
EventLocation location)
Reports an error of type errorType. |
void |
reportRuntimeError(int errorType,
int msgCode,
java.lang.Object[] args,
EventLocation location)
Reports a runtime error. |
void |
setHandler(ErrorHandler handler)
Sets the error handler. |
void |
setWriteClassInfo(boolean flag)
If flag is true, then this object will prepend error messages with the class and method name where the error occured, if this information exists; otherwise the class information is not written to the error message. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ERROR
public static final int RECOVERABLE_ERROR
public static final int WARNING
public static final int RUNTIME
public static final int EXCEPTION
| Constructor Detail |
|---|
public ErrorReporter()
public ErrorReporter(ErrorHandler handler,
MessageProvider messages,
MessageProvider implementationMessages)
| Method Detail |
|---|
public void setHandler(ErrorHandler handler)
handler - The new error handler.getHandler()public ErrorHandler getHandler()
setHandler(com.ibm.spatial.ErrorHandler)public void setWriteClassInfo(boolean flag)
flag - If true, then the class information will
be prepended to the error message; otherwise, the class
information will not be present in the error message.getWriteClassInfo()public boolean getWriteClassInfo()
setWriteClassInfo for the flag definition.
setWriteClassInfo(boolean)
public void reportError(int errorType,
int msgCode,
java.lang.Object[] args,
EventLocation location)
throws SpatialException
errorType - The type of the errormsgCode - The error message codeargs - Arguments for error message textlocation - The error location information
SpatialException - A SpatialException is thrown depending on
the decision taken by the error handler.
java.lang.IllegalArgumentException - if an unknown error type is passed in
errorType.
public void reportRuntimeError(int errorType,
int msgCode,
java.lang.Object[] args,
EventLocation location)
errorType - The type of the errormsgCode - The error message code. Legal values are:
args - Arguments for error message textlocation - The error location information
java.lang.RuntimeException - A subclass of RuntimeException
java.lang.IllegalArgumentException - in case the message code is not
a legal runtime error code.
public static java.lang.String formatMessage(int msgCode,
MessageProvider provider,
java.lang.Object[] args,
EventLocation location,
boolean writeClassInfo)
msgCode - message codeargs - array of Object to be used as arguments for
message formattinglocation - the event location
public static java.lang.StringBuffer formatEventLocation(java.lang.StringBuffer buf,
EventLocation location,
boolean writeClassInfo)
The format of the returned data is: "entityId.subentityId(line:column): ".
buf - message bufferlocation - the event location to format in the message buffer
|
Spatial DataBlade JAVA API v8.21 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||