Package fmpp.dataloaders
Class AbstractTextDataLoader
java.lang.Object
fmpp.dataloaders.FileDataLoader
fmpp.dataloaders.AbstractTextDataLoader
- All Implemented Interfaces:
DataLoader
- Direct Known Subclasses:
SlicedTextDataLoader
Returns a string based on a plain text file.
-
Field Summary
Fields inherited from class fmpp.dataloaders.FileDataLoader
args, dataFile, engine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Object
load
(InputStream data) FileDataLoader
subclasess override this method to parse the file.protected abstract String
parseExtraArguments
(List args) Parses the argument list, except the 1st (file name) argument.protected abstract Object
Parses the file content to the final object that the data loader will return.Methods inherited from class fmpp.dataloaders.FileDataLoader
load
-
Constructor Details
-
AbstractTextDataLoader
public AbstractTextDataLoader()
-
-
Method Details
-
load
Description copied from class:FileDataLoader
FileDataLoader
subclasess override this method to parse the file.- Specified by:
load
in classFileDataLoader
- Throws:
Exception
-
parseText
Parses the file content to the final object that the data loader will return.- Parameters:
text
- the content of the text file- Returns:
- the return value of the data loader
- Throws:
Exception
-
parseExtraArguments
Parses the argument list, except the 1st (file name) argument.- Parameters:
args
- the arguments (all of them, starting from the 1st)- Returns:
- the encoding given with the extra arguments, or
null
if the encoding was not specified. In the latest case the encoding will default to the source encoding engine parameter (the sourceEncoding setting). - Throws:
Exception
-