public abstract class AbstractLoader
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractLoader.ErrorHandler
Handler for reporting errors from the AbstractLoader.
|
static class |
AbstractLoader.LoggingErrorHandler
Error handler that logs errors to a text stream.
|
| Constructor and Description |
|---|
AbstractLoader(java.lang.ClassLoader classloader,
AbstractLoader.ErrorHandler errorHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
handlePropertyEntry(java.lang.Class<?> clazz,
java.lang.String description,
Candidate.CandidateType type)
Will receive one class and its description pairs from the file
|
void |
loadFrom(java.io.InputStream inputStream,
Candidate.CandidateType type) |
void |
loadFromResource(java.lang.String resource,
Candidate.CandidateType type)
Load a candidate property file
|
public AbstractLoader(java.lang.ClassLoader classloader,
AbstractLoader.ErrorHandler errorHandler)
classloader - ClassLoader from which candidates classes are loadederrorHandler - Handler called in case of errorpublic void loadFrom(java.io.InputStream inputStream,
Candidate.CandidateType type)
throws java.io.IOException
inputStream - Stream containing the propertiestype - Type of the candidate loaded from the streamjava.io.IOException - If something goes wrong while reading the streampublic void loadFromResource(java.lang.String resource,
Candidate.CandidateType type)
throws java.io.IOException
resource - File nametype - Type of the candidate loaded from the streamjava.io.IOException - If there's problem reading the fileprotected abstract void handlePropertyEntry(java.lang.Class<?> clazz,
java.lang.String description,
Candidate.CandidateType type)
clazz - class on the linedescription - description of the classtype - type of the candidate