public abstract class AbstractLoader extends 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(ClassLoader classloader,
AbstractLoader.ErrorHandler errorHandler) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
handlePropertyEntry(Class<?> clazz,
String description,
Candidate.CandidateType type)
Will receive one class and its description pairs from the file
|
void |
loadFrom(InputStream inputStream,
Candidate.CandidateType type) |
void |
loadFromResource(String resource,
Candidate.CandidateType type)
Load a candidate property file
|
public AbstractLoader(ClassLoader classloader, AbstractLoader.ErrorHandler errorHandler)
classloader
- ClassLoader from which candidates classes are loadederrorHandler
- Handler called in case of errorpublic void loadFrom(InputStream inputStream, Candidate.CandidateType type) throws IOException
inputStream
- Stream containing the propertiestype
- Type of the candidate loaded from the streamIOException
- If something goes wrong while reading the streampublic void loadFromResource(String resource, Candidate.CandidateType type) throws IOException
resource
- File nametype
- Type of the candidate loaded from the streamIOException
- If there's problem reading the fileprotected abstract void handlePropertyEntry(Class<?> clazz, String description, Candidate.CandidateType type)
clazz
- class on the linedescription
- description of the classtype
- type of the candidateCopyright © 2006–2021 Joe Walnes, Henri Tremblay, Leonardo Mesquita. All rights reserved.