org.objenesis.tck
Class CandidateLoader

java.lang.Object
  extended by org.objenesis.tck.CandidateLoader

public class CandidateLoader
extends java.lang.Object

Loads a set of candidate classes from a properties file into the TCK.

The properties file takes the form of candidateClassName=shortDescription.

Author:
Joe Walnes
See Also:
TCK

Nested Class Summary
static interface CandidateLoader.ErrorHandler
          Handler for reporting errors from the CandidateLoader.
static class CandidateLoader.LoggingErrorHandler
          Error handler that logs errors to a text stream.
 
Constructor Summary
CandidateLoader(TCK tck, java.lang.ClassLoader classloader, CandidateLoader.ErrorHandler errorHandler)
           
 
Method Summary
 void loadFrom(java.io.InputStream inputStream)
           
 void loadFromResource(java.lang.Class cls, java.lang.String resource)
          Load a candidate property file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CandidateLoader

public CandidateLoader(TCK tck,
                       java.lang.ClassLoader classloader,
                       CandidateLoader.ErrorHandler errorHandler)
Parameters:
tck - TCK that will use the candidates
classloader - ClassLoader from which candidates classes are loaded
errorHandler - Handler called in case of error
Method Detail

loadFrom

public void loadFrom(java.io.InputStream inputStream)
              throws java.io.IOException
Parameters:
inputStream - Stream containing the properties
Throws:
java.io.IOException - If something goes wrong while reading the stream

loadFromResource

public void loadFromResource(java.lang.Class cls,
                             java.lang.String resource)
                      throws java.io.IOException
Load a candidate property file

Parameters:
cls - Class on which getResourceAsStream is called
resource - File name
Throws:
java.io.IOException - If there's problem reading the file


Copyright © {inceptionYear}-2009 null. All Rights Reserved.