Package org.objenesis.tck
Class AbstractLoader
java.lang.Object
org.objenesis.tck.AbstractLoader
- Direct Known Subclasses:
CandidateLoader
Class loading a property file and delegating the treatment of each line to a concrete implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Handler for reporting errors from the AbstractLoader.static class
Error handler that logs errors to a text stream. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLoader
private final AbstractLoader.ErrorHandler
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractLoader
(ClassLoader classloader, AbstractLoader.ErrorHandler errorHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
handlePropertyEntry
(Class<?> clazz, String description, Candidate.CandidateType type) Will receive one class and its description pairs from the fileprivate void
handlePropertyEntry
(String key, String value, Candidate.CandidateType type) void
loadFrom
(InputStream inputStream, Candidate.CandidateType type) void
loadFromResource
(String resource, Candidate.CandidateType type) Load a candidate property file
-
Field Details
-
classloader
-
errorHandler
-
-
Constructor Details
-
AbstractLoader
- Parameters:
classloader
- ClassLoader from which candidates classes are loadederrorHandler
- Handler called in case of error
-
-
Method Details
-
loadFrom
- Parameters:
inputStream
- Stream containing the propertiestype
- Type of the candidate loaded from the stream- Throws:
IOException
- If something goes wrong while reading the stream
-
loadFromResource
Load a candidate property file- Parameters:
resource
- File nametype
- Type of the candidate loaded from the stream- Throws:
IOException
- If there's problem reading the file
-
handlePropertyEntry
-
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 linedescription
- description of the classtype
- type of the candidate
-