接口 LineMapper<T>
- 类型参数:
T
- type of the domain object
- 所有已知实现类:
DefaultLineMapper
,JsonLineMapper
,PassThroughLineMapper
,PatternMatchingCompositeLineMapper
public interface LineMapper<T>
Interface for mapping lines (strings) to domain objects typically used to map lines read from a file to domain objects on a per line basis. Implementations of this interface perform the actual work of parsing a line without having to deal with how the line was obtained.- 从以下版本开始:
- 2.0
- 作者:
- Robert Kasanicky
- 另请参阅:
FieldSetMapper
,LineTokenizer
方法详细资料
mapLine
T mapLine(java.lang.String line, int lineNumber) throws java.lang.Exception
Implementations must implement this method to map the provided line to the parameter type T. The line number represents the number of lines into a file the current line resides.- 参数:
line
- to be mappedlineNumber
- of the current line- 返回:
- mapped object of type T
- 抛出:
java.lang.Exception
- if error occurred while parsing.