OPEN - issue BATCH-767: Update documentation for M2
http://jira.springframework.org/browse/BATCH-767 First pass through chapters 2, 3 and Appendix A.
This commit is contained in:
@@ -46,6 +46,6 @@ public interface ItemReader<T> {
|
||||
*
|
||||
* @throws Exception if an underlying resource is unavailable.
|
||||
*/
|
||||
T read() throws Exception, UnexpectedInputException, NoWorkFoundException, ParseException;
|
||||
T read() throws Exception, UnexpectedInputException, ParseException;
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.util.ClassUtils;
|
||||
* better performance.
|
||||
*
|
||||
* In order to reduce the memory usage for large results the persistence context is flushed and cleared
|
||||
* after each page is read. This cuases any entities read to be detached. If you make changes to the
|
||||
* after each page is read. This causes any entities read to be detached. If you make changes to the
|
||||
* entities and want the changes persisted then you must explicitly merge the entities.
|
||||
*
|
||||
* The reader must be configured with an {@link javax.persistence.EntityManagerFactory}. All entity access
|
||||
|
||||
@@ -1,13 +1,33 @@
|
||||
package org.springframework.batch.item.file.mapping;
|
||||
|
||||
import org.springframework.batch.item.file.FlatFileItemReader;
|
||||
import org.springframework.batch.item.file.transform.LineTokenizer;
|
||||
|
||||
|
||||
/**
|
||||
* Interface for mapping lines (strings) to domain objects.
|
||||
* Interface for mapping lines (strings) to domain objects typically used by
|
||||
* {@link FlatFileItemReader} 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.
|
||||
*
|
||||
* @author Robert Kasanicky
|
||||
*
|
||||
* @param <T> type of the domain object
|
||||
* @see FieldSetMapper
|
||||
* @see LineTokenizer
|
||||
* @since 2.0
|
||||
*/
|
||||
public interface LineMapper<T> {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param line to be mapped
|
||||
* @param lineNumber of the current line
|
||||
* @return mapped object of type T
|
||||
* @throws Exception if error occured while parsing.
|
||||
*/
|
||||
T mapLine(String line, int lineNumber) throws Exception;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ItemStream;
|
||||
import org.springframework.batch.item.ItemStreamException;
|
||||
import org.springframework.batch.item.NoWorkFoundException;
|
||||
import org.springframework.batch.item.ParseException;
|
||||
import org.springframework.batch.item.UnexpectedInputException;
|
||||
import org.springframework.batch.item.util.ExecutionContextUserSupport;
|
||||
@@ -57,7 +56,7 @@ public abstract class AbstractItemCountingItemStreamItemReader<T> implements Ite
|
||||
}
|
||||
}
|
||||
|
||||
public T read() throws Exception, UnexpectedInputException, NoWorkFoundException, ParseException {
|
||||
public T read() throws Exception, UnexpectedInputException, ParseException {
|
||||
currentItemCount++;
|
||||
return doRead();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user