Class TextLineParser
java.lang.Object
de.iip_ecosphere.platform.connectors.parser.TextLineParser
- All Implemented Interfaces:
InputParser<String>
@MachineParser(supportsHierarchicalNames=false)
public class TextLineParser
extends Object
implements InputParser<String>
Implements a generic line parser, i.e., data instances are assumed to be given in a
single line of text.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOwn parser converter type to hide implementing class for future modifications.static classOwn parser result type to hide implementing class for future modifications.Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.connectors.parser.InputParser
InputParser.InputConverter<T>, InputParser.ParseResult<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringstatic final TextLineParser.TextLineParserConverterprivate StringFields inherited from interface de.iip_ecosphere.platform.connectors.parser.InputParser
SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionTextLineParser(String charset, String separator) Creates a new text line parser. -
Method Summary
Modifier and TypeMethodDescriptionReturns a type converter for parsed data.parse(byte[] data) Parses a chunk of data received from a source.
-
Field Details
-
CONVERTER
-
charset
-
separator
-
-
Constructor Details
-
TextLineParser
Creates a new text line parser.- Parameters:
charset- the charset of the text encoding (preliminary as string)separator- the separator to be used between data fields; the separator may be empty returning then the entire input strings instead of splitting them
-
-
Method Details
-
parse
Description copied from interface:InputParserParses a chunk of data received from a source.- Specified by:
parsein interfaceInputParser<String>- Parameters:
data- the data- Returns:
- parsing result
- Throws:
IOException- if parsing fails for some reasons
-
getConverter
Description copied from interface:InputParserReturns a type converter for parsed data.- Specified by:
getConverterin interfaceInputParser<String>- Returns:
- the type converter
-