| 1 | |
package org.jbehave.core.configuration; |
| 2 | |
|
| 3 | |
import java.io.PrintStream; |
| 4 | |
import java.lang.annotation.Annotation; |
| 5 | |
|
| 6 | |
public class PrintStreamAnnotationMonitor implements AnnotationMonitor { |
| 7 | |
|
| 8 | |
private final PrintStream output; |
| 9 | |
|
| 10 | |
public PrintStreamAnnotationMonitor() { |
| 11 | 17 | this(System.out); |
| 12 | 17 | } |
| 13 | |
|
| 14 | 17 | public PrintStreamAnnotationMonitor(PrintStream output) { |
| 15 | 17 | this.output = output; |
| 16 | 17 | } |
| 17 | |
|
| 18 | |
public void elementCreationFailed(Class<?> elementClass, Exception cause) { |
| 19 | 2 | output.println("Element creation failed: " + elementClass); |
| 20 | 2 | cause.printStackTrace(output); |
| 21 | 2 | } |
| 22 | |
|
| 23 | |
public void annotationNotFound(Class<? extends Annotation> annotation, Object annotatedInstance) { |
| 24 | 4 | output.println("Annotation " + annotation + " not found in "+annotatedInstance); |
| 25 | 4 | } |
| 26 | |
|
| 27 | |
} |