Package fmpp.dataloaders
Class SlicedTextDataLoader
- java.lang.Object
-
- fmpp.dataloaders.FileDataLoader
-
- fmpp.dataloaders.AbstractTextDataLoader
-
- fmpp.dataloaders.SlicedTextDataLoader
-
- All Implemented Interfaces:
DataLoader
public class SlicedTextDataLoader extends AbstractTextDataLoader
Returns a sequence of strings based on a plain text file, where the specified symbol is used as separator. For more information please read the FMPP Manual.
-
-
Field Summary
-
Fields inherited from class fmpp.dataloaders.FileDataLoader
args, dataFile, engine
-
-
Constructor Summary
Constructors Constructor Description SlicedTextDataLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringparseExtraArguments(java.util.List args)Parses the argument list, except the 1st (file name) argument.protected java.lang.ObjectparseText(java.lang.String text)Parses the file content to the final object that the data loader will return.protected java.util.ListpostProcessItems(java.util.List items)Override this if you want to post-process the items.-
Methods inherited from class fmpp.dataloaders.AbstractTextDataLoader
load
-
Methods inherited from class fmpp.dataloaders.FileDataLoader
load
-
-
-
-
Method Detail
-
parseText
protected final java.lang.Object parseText(java.lang.String text) throws java.lang.ExceptionDescription copied from class:AbstractTextDataLoaderParses the file content to the final object that the data loader will return.- Specified by:
parseTextin classAbstractTextDataLoader- Parameters:
text- the content of the text file- Returns:
- the return value of the data loader
- Throws:
java.lang.Exception
-
postProcessItems
protected java.util.List postProcessItems(java.util.List items)
Override this if you want to post-process the items.- Parameters:
items- the list ofString-s that the standard slicedText data loader would return.- Returns:
- the final return value of the custom data loader.
-
parseExtraArguments
protected final java.lang.String parseExtraArguments(java.util.List args) throws java.lang.ExceptionDescription copied from class:AbstractTextDataLoaderParses the argument list, except the 1st (file name) argument.- Specified by:
parseExtraArgumentsin classAbstractTextDataLoader- Parameters:
args- the arguments (all of them, starting from the 1st)- Returns:
- the encoding given with the extra arguments, or
nullif the encoding was not specified. In the latest case the encoding will default to the source encoding engine parameter (the sourceEncoding setting). - Throws:
java.lang.Exception
-
-