|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.josql.filters.AbstractJoSQLFilter org.josql.filters.StackTraceElementFilter
public class StackTraceElementFilter
This class allows you to filter the stack trace of a Throwable, so cutting down on the (sometimes) pointless long stack traces.
Usage:
SELECT * FROM java.lang.StackTraceElement WHERE className LIKE 'org.josql.%'And then to use in code:
StackTraceElementFilter f = new StackTraceElementFilter (sql); f.filter (new Throwable ());
Field Summary |
---|
Fields inherited from class org.josql.filters.AbstractJoSQLFilter |
---|
badQuery, exp, q |
Constructor Summary | |
---|---|
StackTraceElementFilter(Query q)
Init this file filter with the query already built and parsed. |
|
StackTraceElementFilter(String q)
Init this filter with the query. |
Method Summary | |
---|---|
boolean |
accept(Object o)
|
boolean |
accept(StackTraceElement s)
Returns true if the where clause evaluates to true for the
passed in StackTraceElement. |
void |
filter(Throwable t)
Filter the throwable, but will also filter any causes (right up the cause chain) as well. |
void |
filter(Throwable t,
boolean filterCause)
Filter the throwable, but will also filter any causes (right up the cause chain) as well if the filterCause boolean is set to true . |
StackTraceElement[] |
filterStackTrace(StackTraceElement[] s)
Filter the specified stack trace and return the new stack trace that can then be set in the throwable. |
Class |
getExpectedClass()
Get the expected class. |
Methods inherited from class org.josql.filters.AbstractJoSQLFilter |
---|
clearException, getException, getQuery, setQuery, setQuery |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StackTraceElementFilter(String q) throws QueryParseException
q
- The query.
QueryParseException
- If there is an issue with the parsing of the query,
or if the FROM class is not equal to the expected class.public StackTraceElementFilter(Query q) throws IllegalStateException, QueryParseException
q
- The query.
IllegalStateException
- If the Query object has not been parsed.
QueryParseException
- If the FROM class is not as expected.Method Detail |
---|
public Class getExpectedClass()
getExpectedClass
in class AbstractJoSQLFilter
StackTraceElement
.public boolean accept(Object o)
accept
in class AbstractJoSQLFilter
public boolean accept(StackTraceElement s) throws QueryExecutionException
true
if the where clause evaluates to true for the
passed in StackTraceElement.
s
- The object to evaluate the WHERE clause against.
true
if the WHERE clause evaluates to true
for the specified
object.
QueryExecutionException
public StackTraceElement[] filterStackTrace(StackTraceElement[] s) throws QueryExecutionException
s
- The stack trace.
QueryExecutionException
- If the where clause cannot be
executed against a particular element.public void filter(Throwable t) throws QueryExecutionException
filter(Throwable,boolean)
with the
boolean set to true
.
t
- The throwable instance to filter.
QueryExecutionException
- If the where clause cannot be executed.public void filter(Throwable t, boolean filterCause) throws QueryExecutionException
true
.
t
- The throwable instance to filter.filterCause
- When set to true
will also filter the cause
chain as well.
QueryExecutionException
- If the where clause cannot be executed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |