NullAnnotationMonitor.java

  1. package org.jbehave.core.configuration;

  2. import java.lang.annotation.Annotation;

  3. /**
  4.  * <a href="http://en.wikipedia.org/wiki/Null_Object_pattern">Null Object
  5.  * Pattern</a> implementation of {@link AnnotationMonitor}. Can be extended to
  6.  * override only the methods of interest.
  7.  */
  8. public class NullAnnotationMonitor implements AnnotationMonitor {

  9.     @Override
  10.     public void elementCreationFailed(Class<?> elementClass, Exception cause) {
  11.         // Do nothing by default
  12.     }

  13.     @Override
  14.     public void annotationNotFound(Class<? extends Annotation> annotation, Object annotatedInstance) {
  15.         // Do nothing by default
  16.     }
  17. }