Class ListLoader
java.lang.Object
de.uni_hildesheim.sse.easy.loader.AbstractStartupInfoLoader
de.uni_hildesheim.sse.easy.loader.ListLoader
- All Implemented Interfaces:
ILoader
Implements an EASy loader which obtains the start sequence from a text file.
- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a list loader that reads the startup sequence from the current class loader, i.e., fromEASY_STARTUP_FILE_NAME.ListLoader(File listFile) Creates a list loader that reads the startup sequence from the given file.ListLoader(File listFile, ClassLoader loader) Creates a list loader that reads the startup sequence from the given file.Creates a list loader that reads the startup sequence from an input stream.ListLoader(Reader reader) Creates a list loader that reads the startup sequence from a reader.ListLoader(ClassLoader loader) Creates a list loader that reads the startup sequence from the given class loader, i.e., fromEASY_STARTUP_FILE_NAME. -
Method Summary
Modifier and TypeMethodDescriptionprivate static InputStreamgetStream(File listFile, ClassLoader loader) Returns the underlying input stream.private static List<StartupInfo> load(InputStream is) Loads the startup sequence from an input stream.private static List<StartupInfo> Loads the startup sequence from a reader.private static voidprocessLine(String line, List<StartupInfo> startupSequence) Processes a single line from the startup sequence file.Methods inherited from class de.uni_hildesheim.sse.easy.loader.AbstractStartupInfoLoader
getLoader, isVerbose, setLoader, setStartupSequence, setVerbose, shutdown, startup
-
Field Details
-
EASY_STARTUP_FILE_NAME
- See Also:
-
-
Constructor Details
-
ListLoader
Creates a list loader that reads the startup sequence from the current class loader, i.e., fromEASY_STARTUP_FILE_NAME.- Throws:
IOException- in case of loading the startup sequence fails
-
ListLoader
Creates a list loader that reads the startup sequence from the given class loader, i.e., fromEASY_STARTUP_FILE_NAME.- Parameters:
loader- the class loader to load from- Throws:
IOException- in case of loading the startup sequence fails
-
ListLoader
Creates a list loader that reads the startup sequence from the given file.- Parameters:
listFile- the file to consider (may be null for reading information from the defailt classloader resource)- Throws:
IOException- in case of loading the startup sequence fails
-
ListLoader
Creates a list loader that reads the startup sequence from the given file.- Parameters:
listFile- the file to consider (may be null for reading information fromloader)loader- the class loader to load from- Throws:
IOException- in case of loading the startup sequence fails
-
ListLoader
Creates a list loader that reads the startup sequence from an input stream.iswill be closed by this constructor.- Parameters:
is- the input stream containing the startup sequence- Throws:
IOException- in case of loading the startup sequence fails
-
ListLoader
Creates a list loader that reads the startup sequence from a reader.readerwill be closed by this constructor.- Parameters:
reader- the reader providing access to the startup sequence- Throws:
IOException- in case of loading the startup sequence fails
-
-
Method Details
-
load
Loads the startup sequence from an input stream.iswill not be closed by this method.- Parameters:
is- the input stream containing the startup sequence- Returns:
- the loaded startup information
- Throws:
IOException- in case of loading the startup sequence fails
-
getStream
Returns the underlying input stream.- Parameters:
listFile- the file to consider (may be null for reading information fromloader)loader- the class loader to load from- Returns:
- the input stream
- Throws:
IOException- in case of loading the startup sequence fails
-
load
Loads the startup sequence from a reader.readerwill be closed by this method.- Parameters:
reader- the reader providing access to the startup sequence- Returns:
- the loaded startup information
- Throws:
IOException- in case of loading the startup sequence fails
-
processLine
Processes a single line from the startup sequence file.- Parameters:
line- the line to be processedstartupSequence- the startup sequence to be modified as a side effect
-