Class TextLineParser
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.parser.TextLineParser
-
- All Implemented Interfaces:
InputParser<java.lang.String>
@MachineParser(supportsHierarchicalNames=false) public class TextLineParser extends java.lang.Object implements InputParser<java.lang.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 Classes Modifier and Type Class Description static classTextLineParser.TextLineParserConverterOwn parser converter type to hide implementing class for future modifications.static classTextLineParser.TextLineParseResultOwn 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
Fields Modifier and Type Field Description private java.lang.Stringcharsetstatic TextLineParser.TextLineParserConverterCONVERTERprivate java.lang.Stringseparator-
Fields inherited from interface de.iip_ecosphere.platform.connectors.parser.InputParser
SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description TextLineParser(java.lang.String charset, java.lang.String separator)Creates a new text line parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextLineParser.TextLineParserConvertergetConverter()Returns a type converter for parsed data.TextLineParser.TextLineParseResultparse(byte[] data)Parses a chunk of data received from a source.
-
-
-
Field Detail
-
CONVERTER
public static final TextLineParser.TextLineParserConverter CONVERTER
-
charset
private java.lang.String charset
-
separator
private java.lang.String separator
-
-
Method Detail
-
parse
public TextLineParser.TextLineParseResult parse(byte[] data) throws java.io.IOException
Description copied from interface:InputParserParses a chunk of data received from a source.- Specified by:
parsein interfaceInputParser<java.lang.String>- Parameters:
data- the data- Returns:
- parsing result
- Throws:
java.io.IOException- if parsing fails for some reasons
-
getConverter
public TextLineParser.TextLineParserConverter getConverter()
Description copied from interface:InputParserReturns a type converter for parsed data.- Specified by:
getConverterin interfaceInputParser<java.lang.String>- Returns:
- the type converter
-
-