public class ErrorCollector
extends java.lang.Object
Object
instances,
with special summarizing if the same exceptions are signalled multiple times.Modifier and Type | Class and Description |
---|---|
static class |
ErrorCollector.ErrorInfo |
static class |
ErrorCollector.ErrorInfos |
Constructor and Description |
---|
ErrorCollector() |
Modifier and Type | Method and Description |
---|---|
ErrorCollector.ErrorInfos |
addError(java.lang.Object forObject,
java.lang.Exception ex)
Stores - if no error (exception) of the given type occurred until now - or
otherwise updates info about the given error for the given object.
|
ErrorCollector.ErrorInfos |
addError(java.lang.Object forObject,
java.lang.Exception ex,
java.lang.String msg) |
void |
clearErrors(java.lang.Object forObject)
Clears all stored error infos for the given object.
|
void |
dumpToLog(org.apache.log4j.Logger log)
Dumps the information from this
ErrorCollector instance to the
given Logger . |
void |
dumpToLog(org.apache.log4j.Logger log,
org.apache.log4j.Level level) |
java.util.HashMap<java.lang.Object,ErrorCollector.ErrorInfos> |
getErrorinfosByObject()
Class that stores info about different kinds of errors for one object.
|
ErrorCollector.ErrorInfos |
getErrors(java.lang.Object forObject)
Gets error infos stored for the given object.
|
boolean |
hasErrors()
Returns if any errors have been stored yet.
|
boolean |
hasErrorsFor(java.lang.Object forObject)
Returns if errors for the given object have been stored yet.
|
void |
logAndStoreProblem(org.apache.log4j.Logger log,
java.lang.Object forObject,
java.lang.Exception ex,
java.lang.String msg)
Logs the given message and exception and stores the info in this
ErrorCollector too. |
void |
logAndStoreProblem(org.apache.log4j.Logger log,
java.lang.Object forObject,
java.lang.Exception ex,
java.lang.String msg,
org.apache.log4j.Level level) |
void |
setErrorinfosByObject(java.util.HashMap<java.lang.Object,ErrorCollector.ErrorInfos> $5) |
public ErrorCollector.ErrorInfos addError(java.lang.Object forObject, java.lang.Exception ex)
forObject
- the Object
that caused or was affected by the
errorex
- the Exception
that occurred and for which info should
be initially stored or updatedmsg
- an optional, additional message that should be stored with the error; should a previous message for
the exception type exist it will be overwritten with this new one, if one is givenErrorInfos
instance which stores error infos for the
given objectpublic ErrorCollector.ErrorInfos addError(java.lang.Object forObject, java.lang.Exception ex, java.lang.String msg)
public boolean hasErrors()
public boolean hasErrorsFor(java.lang.Object forObject)
public ErrorCollector.ErrorInfos getErrors(java.lang.Object forObject)
forObject
- the Object
for which error info is wantedErrorInfos
instance which stores error infos for the
given object; null if no info is stored for that objectpublic void clearErrors(java.lang.Object forObject)
forObject
- the Object
for which error infos should be
clearedpublic void dumpToLog(org.apache.log4j.Logger log)
ErrorCollector
instance to the
given Logger
. Mainly for debugging purposes.log
- the Logger
to dump the info topublic void dumpToLog(org.apache.log4j.Logger log, org.apache.log4j.Level level)
public void logAndStoreProblem(org.apache.log4j.Logger log, java.lang.Object forObject, java.lang.Exception ex, java.lang.String msg)
ErrorCollector
too.public void logAndStoreProblem(org.apache.log4j.Logger log, java.lang.Object forObject, java.lang.Exception ex, java.lang.String msg, org.apache.log4j.Level level)
public java.util.HashMap<java.lang.Object,ErrorCollector.ErrorInfos> getErrorinfosByObject()
public void setErrorinfosByObject(java.util.HashMap<java.lang.Object,ErrorCollector.ErrorInfos> $5)
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.