Class DefaultStackTraceFilterer

  • All Implemented Interfaces:
    StackTraceFilterer

    public class DefaultStackTraceFilterer
    extends java.lang.Object
    implements StackTraceFilterer
    Default implementation of StackTraceFilterer.
    Since:
    2.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addInternalPackage​(java.lang.String name)
      Adds a package name that should be filtered
      java.lang.Throwable filter​(java.lang.Throwable source)
      Remove all apparently Grails-internal trace entries from the exception instance
      java.lang.Throwable filter​(java.lang.Throwable source, boolean recursive)
      Remove all apparently Grails-internal trace entries from the exception instance
      protected boolean isApplicationClass​(java.lang.String className)
      Whether the given class name is an internal class and should be filtered
      void setCutOffPackage​(java.lang.String cutOffPackage)
      Sets the package where the stack trace should end
      void setShouldFilter​(boolean shouldFilter)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STACK_LOG

        public static final org.apache.commons.logging.Log STACK_LOG
    • Constructor Detail

      • DefaultStackTraceFilterer

        public DefaultStackTraceFilterer()
      • DefaultStackTraceFilterer

        public DefaultStackTraceFilterer​(boolean shouldFilter)
    • Method Detail

      • addInternalPackage

        public void addInternalPackage​(java.lang.String name)
        Description copied from interface: StackTraceFilterer
        Adds a package name that should be filtered
        Specified by:
        addInternalPackage in interface StackTraceFilterer
        Parameters:
        name - The name of the package
      • setCutOffPackage

        public void setCutOffPackage​(java.lang.String cutOffPackage)
        Description copied from interface: StackTraceFilterer
        Sets the package where the stack trace should end
        Specified by:
        setCutOffPackage in interface StackTraceFilterer
        Parameters:
        cutOffPackage - The cut off package
      • filter

        public java.lang.Throwable filter​(java.lang.Throwable source,
                                          boolean recursive)
        Description copied from interface: StackTraceFilterer

        Remove all apparently Grails-internal trace entries from the exception instance

        This modifies the original instance and returns it, it does not clone

        Specified by:
        filter in interface StackTraceFilterer
        Parameters:
        source - The source exception
        recursive - 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: StackTraceFilterer

        Remove all apparently Grails-internal trace entries from the exception instance

        This modifies the original instance and returns it, it does not clone

        Specified by:
        filter in interface StackTraceFilterer
        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:
        setShouldFilter in interface StackTraceFilterer
        Parameters:
        shouldFilter - Whether to filter stack traces or not