public class EgovFlatFileByteReader<T>
extends org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>
implements org.springframework.batch.item.file.ResourceAwareItemReaderItemStream<T>, org.springframework.beans.factory.InitializingBean
<< 개정이력(Modification Information) >> 수정일 수정자 수정내용 ------- -------- --------------------------- 2012. 10.20 배치실행개발팀 최초 생성
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CHARSET |
static int |
LINE_CRLF |
| Constructor and Description |
|---|
EgovFlatFileByteReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
doClose() |
protected void |
doOpen() |
protected T |
doRead()
Byte단위로 읽어들인 한 라인을 ValueObject로 매핑
|
protected void |
jumpToItem(int itemIndex) |
void |
setBufferedReaderFactory(EgovByteReaderFactory bufferedReaderFactory)
Factory for the
BufferedReader that will be used to extract lines
from the file. |
void |
setComments(String[] comments)
Setter for comment prefixes.
|
void |
setEncoding(String encoding)
Setter for the encoding for this input source.
|
void |
setLength(int length)
lengh
|
void |
setLineMapper(EgovByteLineMapper<T> lineMapper)
Setter for line mapper.
|
void |
setOsType(String osType)
osType
|
void |
setRecordSeparatorPolicy(org.springframework.batch.item.file.separator.RecordSeparatorPolicy recordSeparatorPolicy)
Public setter for the recordSeparatorPolicy.
|
void |
setResource(org.springframework.core.io.Resource resource)
Public setter for the input resource.
|
void |
setStrict(boolean strict)
In strict mode the reader will throw an exception on
AbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext) if the
input resource does not exist. |
close, getCurrentItemCount, isSaveState, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, updategetExecutionContextKey, setExecutionContextName, setNamepublic static final String DEFAULT_CHARSET
public static int LINE_CRLF
public void setStrict(boolean strict)
AbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext) if the
input resource does not exist.strict - false by defaultpublic void setLineMapper(EgovByteLineMapper<T> lineMapper)
lineMapper - maps line to itempublic void setEncoding(String encoding)
DEFAULT_CHARSET.encoding - a properties object which possibly contains the encoding for
this input file;public void setLength(int length)
public void setOsType(String osType)
public void setBufferedReaderFactory(EgovByteReaderFactory bufferedReaderFactory)
BufferedReader that will be used to extract lines
from the file. The default is fine for plain text files, but this is a
useful strategy for binary files where the standard BufferedReaader from
java.io is limiting.bufferedReaderFactory - the bufferedReaderFactory to setpublic void setComments(String[] comments)
comments - an array of comment line prefixes.public void setResource(org.springframework.core.io.Resource resource)
setResource in interface org.springframework.batch.item.file.ResourceAwareItemReaderItemStream<T>public void setRecordSeparatorPolicy(org.springframework.batch.item.file.separator.RecordSeparatorPolicy recordSeparatorPolicy)
recordSeparatorPolicy - the recordSeparatorPolicy to setprotected T doRead() throws Exception
doRead in class org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>setRecordSeparatorPolicy(RecordSeparatorPolicy) (might
span multiple lines in file).Exceptionprotected void doClose()
throws Exception
protected void doOpen()
throws Exception
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionCopyright © 2015. All rights reserved.