• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 package org.mockito.exceptions.stacktrace;
6 
7 /**
8  * Decides if particular StackTraceElement is excluded from the human-readable stack trace output.
9  * Mockito stack trace filtering mechanism uses this information.
10  * <p>
11  * Excluding an element will make it not show in the cleaned stack trace.
12  * Not-excluding an element does not guarantee it will be shown (e.g. it depends on the implementation of
13  * {@linkplain org.mockito.internal.exceptions.stacktrace.StackTraceFilter Mockito internal cleaner}).
14  * <p>
15  * The implementations are required to be thread safe ; for example, make them stateless.
16  * <p>
17  * See also the {@linkplain org.mockito.internal.exceptions.stacktrace.DefaultStackTraceCleaner Mockito default implementation}
18  */
19 public interface StackTraceCleaner {
20 
21     /**
22      * Decides if element is included.
23      *
24      * @param candidate element of the actual stack trace
25      * @return whether the element should be excluded from cleaned stack trace.
26      */
isIn(StackTraceElement candidate)27     boolean isIn(StackTraceElement candidate);
28 }
29