All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xj4.lifecycle.AbstractLifecycle Maven / Gradle / Ivy

package org.xj4.lifecycle;

import org.xj4.XJ4TestClass;

import java.lang.reflect.Field;
import java.util.List;

/**
 * An abstract implementation of a lifecycle.  Subclasses may override the methods as needed.
 *
 * @author Jared Bunting
 */
public abstract class AbstractLifecycle implements Lifecycle {

  /**
   * Returns false.
   * @return false
   */
  public boolean supportsClassLevel() {
    return false;
  }

  /**
   * Returns false.
   * @return false
   */
  public boolean supportsInstanceLevel() {
    return false;
  }

  /**
   * By default, does nothing. Provided for backwards compatibility.
   * @param testClass
   * @param field
   * @param target
   */
  public void start(XJ4TestClass testClass, Field field, Object target) {
    // do nothing
  }

  /**
   * Simply invokes the start method without the dependencies parameter.
   * @param testClass
   * @param field
   * @param target
   * @param dependencies
   */
  public void start(XJ4TestClass testClass, Field field, Object target, Dependencies dependencies) {
    this.start(testClass, field, target);
  }

  /**
   * By default, does nothing. Provided for backwards compatibility.
   * @param testClass
   * @param field
   * @param target
   */
  public void stop(XJ4TestClass testClass, Field field, Object target) {
    // do nothing
  }

  /**
   * Simply invokes the start method without the dependencies parameter.
   * @param testClass
   * @param field
   * @param target
   * @param dependencies
   */
  public void stop(XJ4TestClass testClass, Field field, Object target, Dependencies dependencies) {
    this.stop(testClass, field, target);
  }

  /**
   * Returns false.
   * @return false
   */
  public boolean acceptsNull() {
    return false;
  }

  /**
   * By default, does nothing.
   * @param errors
   * @param field
   */
  public void validate(List errors, Field field) {
    // do nothing
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy