public class UpcastException
extends de.infinityloop.util.exception.RuntimeExceptionNST
Constructor and Description |
---|
UpcastException()
Constructor
|
UpcastException(java.lang.Exception e)
Constructor
|
UpcastException(LogEvent le)
Constructor
|
UpcastException(LogEventCollector coll)
Constructor
|
UpcastException(java.lang.String s)
Constructor
|
Modifier and Type | Method and Description |
---|---|
LogEventCollector |
extractSignificantEntries(int[] types,
int[] including,
int[] excluding)
This method extracts all LogEvent objects from this exception that are significant to you.
|
void |
flushToLogger(LogSource lp)
This flushes all collected events to the specified LogSource, then clears the internal log event list.
|
LogEventCollector |
getEntries()
get the entries of this exception as a List
|
LogEvent |
getEntryByCode(int code)
Returns the (first) entry with the specified code or null if that message is not contained
in this exception.
|
java.lang.String |
getMessage() |
int |
size() |
public UpcastException(java.lang.String s)
s
- human readable messagepublic UpcastException()
public UpcastException(java.lang.Exception e)
e
- the exception to wrappublic UpcastException(LogEventCollector coll)
coll
- the LogEventCollector whose objects we should usepublic LogEventCollector getEntries()
public int size()
public LogEventCollector extractSignificantEntries(int[] types, int[] including, int[] excluding)
null
, all entries are examined. Otherwise, only those that match any of the
contained types are observed.
including
. If
including
is null
, all entries pass this step.
excluding
. If
excluding
is null
, all entries pass this step.
types
- a variable length array of integers containing the type of LogEvent objects you are interested in.
E.g. passing new int[] { LogEvent.ERROR }
will only report entries of type ERROR
.
If you pass null
, all entries are respected.including
- Again in form of a variable size integer array, you can specify which error codes are interesting for you. If you pass null
,
all error codes are observed.excluding
- Same as for including
, but lists the error codes you are not interested in.null
!)public LogEvent getEntryByCode(int code)
code
- the code to look forpublic java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public void flushToLogger(LogSource lp)
lp
- the LogSource to send the log events to