Package org.grails.exceptions.reporting
Class DefaultStackTraceFilterer
- java.lang.Object
-
- org.grails.exceptions.reporting.DefaultStackTraceFilterer
-
- All Implemented Interfaces:
StackTraceFilterer
public class DefaultStackTraceFilterer extends java.lang.Object implements StackTraceFilterer
Default implementation of StackTraceFilterer.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogSTACK_LOGstatic java.lang.StringSTACK_LOG_NAME-
Fields inherited from interface org.grails.exceptions.reporting.StackTraceFilterer
FULL_STACK_TRACE_MESSAGE, SYS_PROP_DISPLAY_FULL_STACKTRACE
-
-
Constructor Summary
Constructors Constructor Description DefaultStackTraceFilterer()DefaultStackTraceFilterer(boolean shouldFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInternalPackage(java.lang.String name)Adds a package name that should be filteredjava.lang.Throwablefilter(java.lang.Throwable source)Remove all apparently Grails-internal trace entries from the exception instancejava.lang.Throwablefilter(java.lang.Throwable source, boolean recursive)Remove all apparently Grails-internal trace entries from the exception instanceprotected booleanisApplicationClass(java.lang.String className)Whether the given class name is an internal class and should be filteredvoidsetCutOffPackage(java.lang.String cutOffPackage)Sets the package where the stack trace should endvoidsetShouldFilter(boolean shouldFilter)
-
-
-
Field Detail
-
STACK_LOG_NAME
public static final java.lang.String STACK_LOG_NAME
- See Also:
- Constant Field Values
-
STACK_LOG
public static final org.apache.commons.logging.Log STACK_LOG
-
-
Method Detail
-
addInternalPackage
public void addInternalPackage(java.lang.String name)
Description copied from interface:StackTraceFiltererAdds a package name that should be filtered- Specified by:
addInternalPackagein interfaceStackTraceFilterer- Parameters:
name- The name of the package
-
setCutOffPackage
public void setCutOffPackage(java.lang.String cutOffPackage)
Description copied from interface:StackTraceFiltererSets the package where the stack trace should end- Specified by:
setCutOffPackagein interfaceStackTraceFilterer- Parameters:
cutOffPackage- The cut off package
-
filter
public java.lang.Throwable filter(java.lang.Throwable source, boolean recursive)Description copied from interface:StackTraceFiltererRemove all apparently Grails-internal trace entries from the exception instance
This modifies the original instance and returns it, it does not clone
- Specified by:
filterin interfaceStackTraceFilterer- Parameters:
source- The source exceptionrecursive- Whether to recursively filter the cause- Returns:
- The exception passed in, after cleaning the stack trace
-
filter
public java.lang.Throwable filter(java.lang.Throwable source)
Description copied from interface:StackTraceFiltererRemove all apparently Grails-internal trace entries from the exception instance
This modifies the original instance and returns it, it does not clone
- Specified by:
filterin interfaceStackTraceFilterer- Parameters:
source- The source exception- Returns:
- The exception passed in, after cleaning the stack trace
-
isApplicationClass
protected boolean isApplicationClass(java.lang.String className)
Whether the given class name is an internal class and should be filtered- Parameters:
className- The class name- Returns:
- true if is internal
-
setShouldFilter
public void setShouldFilter(boolean shouldFilter)
- Specified by:
setShouldFilterin interfaceStackTraceFilterer- Parameters:
shouldFilter- Whether to filter stack traces or not
-
-