Class AbstractLoader

java.lang.Object
org.objenesis.tck.AbstractLoader

public abstract class AbstractLoader extends Object
Class loading a property file and delegating the treatment of each line to a concrete implementations.
  • Constructor Details

    • AbstractLoader

      public AbstractLoader(ClassLoader classloader, AbstractLoader.ErrorHandler errorHandler)
      Parameters:
      classloader - ClassLoader from which candidates classes are loaded
      errorHandler - Handler called in case of error
  • Method Details

    • loadFrom

      public void loadFrom(InputStream inputStream, Candidate.CandidateType type) throws IOException
      Parameters:
      inputStream - Stream containing the properties
      type - Type of the candidate loaded from the stream
      Throws:
      IOException - If something goes wrong while reading the stream
    • loadFromResource

      public void loadFromResource(String resource, Candidate.CandidateType type) throws IOException
      Load a candidate property file
      Parameters:
      resource - File name
      type - Type of the candidate loaded from the stream
      Throws:
      IOException - If there's problem reading the file
    • handlePropertyEntry

      protected abstract void handlePropertyEntry(Class<?> clazz, String description, Candidate.CandidateType type)
      Will receive one class and its description pairs from the file
      Parameters:
      clazz - class on the line
      description - description of the class
      type - type of the candidate