IN PROGRESS - issue BATCH-267: Re-organise I/O (io) packages
http://jira.springframework.org/browse/BATCH-267 Initial draft - separating flat file and xml processing
This commit is contained in:
@@ -94,8 +94,8 @@
|
||||
<bean
|
||||
class="org.springframework.batch.support.IntArrayPropertyEditor" />
|
||||
</entry>
|
||||
<entry key="org.springframework.batch.io.file.support.transform.Range[]">
|
||||
<bean class="org.springframework.batch.io.file.support.transform.RangeArrayPropertyEditor" />
|
||||
<entry key="org.springframework.batch.io.file.transform.Range[]">
|
||||
<bean class="org.springframework.batch.io.file.transform.RangeArrayPropertyEditor" />
|
||||
</entry>
|
||||
<entry key="java.util.Date">
|
||||
<bean
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beansProjectDescription>
|
||||
<configExtensions>
|
||||
<configExtension>xml</configExtension>
|
||||
</configExtensions>
|
||||
<version>1</version>
|
||||
<pluginVersion><![CDATA[2.0.2.v200712142013]]></pluginVersion>
|
||||
<configSuffixes>
|
||||
<configSuffix><![CDATA[xml]]></configSuffix>
|
||||
</configSuffixes>
|
||||
<configs>
|
||||
<config>src/test/resources/org/springframework/batch/io/file/support/mapping/bean-wrapper.xml</config>
|
||||
<config>src/test/resources/org/springframework/batch/io/sql/data-source-context.xml</config>
|
||||
<config>src/test/resources/org/springframework/batch/item/processor/delegating-item-processor.xml</config>
|
||||
<config>src/test/resources/org/springframework/batch/item/processor/pe-delegating-item-processor.xml</config>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
@@ -28,11 +28,11 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.io.exception.BatchEnvironmentException;
|
||||
import org.springframework.batch.io.file.support.transform.Converter;
|
||||
import org.springframework.batch.io.file.transform.Converter;
|
||||
import org.springframework.batch.io.support.AbstractTransactionalIoSource;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.ResourceLifecycle;
|
||||
import org.springframework.batch.restart.GenericRestartData;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
@@ -26,8 +26,8 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchEnvironmentException;
|
||||
import org.springframework.batch.io.file.support.separator.DefaultRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.separator.DefaultRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.separator.RecordSeparatorPolicy;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ResourceLifecycle;
|
||||
import org.springframework.batch.item.provider.AbstractItemReader;
|
||||
@@ -14,17 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.batch.io.exception.FlatFileParsingException;
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.support.transform.AbstractLineTokenizer;
|
||||
import org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.support.transform.LineTokenizer;
|
||||
import org.springframework.batch.io.file.separator.RecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.transform.AbstractLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.LineTokenizer;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ResourceLifecycle;
|
||||
import org.springframework.batch.item.provider.AbstractItemReader;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.mapping;
|
||||
package org.springframework.batch.io.file.mapping;
|
||||
|
||||
import java.beans.PropertyEditor;
|
||||
import java.util.ArrayList;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.io.file.support.mapping;
|
||||
package org.springframework.batch.io.file.mapping;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.mapping;
|
||||
package org.springframework.batch.io.file.mapping;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.util.ArrayList;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class DefaultRecordSeparatorPolicy extends SimpleRecordSeparatorPolicy {
|
||||
* "), and does not end with a continuation marker ('\'). The test for the
|
||||
* continuation marker ignores whitespace at the end of the line.
|
||||
*
|
||||
* @see org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
|
||||
*/
|
||||
public boolean isEndOfRecord(String line) {
|
||||
return !isQuoteUnterminated(line) && !isContinued(line);
|
||||
@@ -94,7 +94,7 @@ public class DefaultRecordSeparatorPolicy extends SimpleRecordSeparatorPolicy {
|
||||
* remove the continuation marker (plus whitespace at the end) if it is
|
||||
* there.
|
||||
*
|
||||
* @see org.springframework.batch.io.file.support.separator.SimpleRecordSeparatorPolicy#preProcess(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.SimpleRecordSeparatorPolicy#preProcess(java.lang.String)
|
||||
*/
|
||||
public String preProcess(String line) {
|
||||
if (isQuoteUnterminated(line)) {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ public class SimpleRecordSeparatorPolicy implements RecordSeparatorPolicy {
|
||||
/**
|
||||
* Always returns true.
|
||||
*
|
||||
* @see org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
|
||||
*/
|
||||
public boolean isEndOfRecord(String line) {
|
||||
return true;
|
||||
@@ -37,7 +37,7 @@ public class SimpleRecordSeparatorPolicy implements RecordSeparatorPolicy {
|
||||
|
||||
/**
|
||||
* Pass the record through. Do nothing.
|
||||
* @see org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy#postProcess(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.RecordSeparatorPolicy#postProcess(java.lang.String)
|
||||
*/
|
||||
public String postProcess(String record) {
|
||||
return record;
|
||||
@@ -45,7 +45,7 @@ public class SimpleRecordSeparatorPolicy implements RecordSeparatorPolicy {
|
||||
|
||||
/**
|
||||
* Pass the line through. Do nothing.
|
||||
* @see org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy#preProcess(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.RecordSeparatorPolicy#preProcess(java.lang.String)
|
||||
*/
|
||||
public String preProcess(String line) {
|
||||
return line;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ public class SuffixRecordSeparatorPolicy extends DefaultRecordSeparatorPolicy {
|
||||
* whitespace is trimmed before the comparison. Also returns true if the
|
||||
* line is null, but not if it is empty.
|
||||
*
|
||||
* @see org.springframework.batch.io.file.support.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
|
||||
*/
|
||||
public boolean isEndOfRecord(String line) {
|
||||
if (line == null) {
|
||||
@@ -72,7 +72,7 @@ public class SuffixRecordSeparatorPolicy extends DefaultRecordSeparatorPolicy {
|
||||
/**
|
||||
* Remove the suffix from the end of the record.
|
||||
*
|
||||
* @see org.springframework.batch.io.file.support.separator.SimpleRecordSeparatorPolicy#postProcess(java.lang.String)
|
||||
* @see org.springframework.batch.io.file.separator.SimpleRecordSeparatorPolicy#postProcess(java.lang.String)
|
||||
*/
|
||||
public String postProcess(String record) {
|
||||
if (record==null) {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
/**
|
||||
* Generic converter interface for transforming an object into another form for
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Arrays;
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package org.springframework.batch.io.support;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.repeat.synch.BatchTransactionSynchronizationManager;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.repeat.RepeatContext;
|
||||
import org.springframework.batch.repeat.RepeatInterceptor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.xml;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -13,11 +13,11 @@ import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.events.StartElement;
|
||||
|
||||
import org.springframework.batch.io.Skippable;
|
||||
import org.springframework.batch.io.file.support.stax.DefaultFragmentEventReader;
|
||||
import org.springframework.batch.io.file.support.stax.DefaultTransactionalEventReader;
|
||||
import org.springframework.batch.io.file.support.stax.FragmentDeserializer;
|
||||
import org.springframework.batch.io.file.support.stax.FragmentEventReader;
|
||||
import org.springframework.batch.io.file.support.stax.TransactionalEventReader;
|
||||
import org.springframework.batch.io.xml.stax.DefaultFragmentEventReader;
|
||||
import org.springframework.batch.io.xml.stax.DefaultTransactionalEventReader;
|
||||
import org.springframework.batch.io.xml.stax.FragmentDeserializer;
|
||||
import org.springframework.batch.io.xml.stax.FragmentEventReader;
|
||||
import org.springframework.batch.io.xml.stax.TransactionalEventReader;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ResourceLifecycle;
|
||||
import org.springframework.batch.item.provider.AbstractItemReader;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.xml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -14,10 +14,10 @@ import javax.xml.stream.XMLEventWriter;
|
||||
import javax.xml.stream.XMLOutputFactory;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.io.file.support.stax.NoStartEndDocumentStreamWriter;
|
||||
import org.springframework.batch.io.file.support.stax.ObjectToXmlSerializer;
|
||||
import org.springframework.batch.io.support.FileUtils;
|
||||
import org.springframework.batch.io.xml.stax.NoStartEndDocumentStreamWriter;
|
||||
import org.springframework.batch.io.xml.stax.ObjectToXmlSerializer;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.ResourceLifecycle;
|
||||
import org.springframework.batch.repeat.synch.BatchTransactionSynchronizationManager;
|
||||
import org.springframework.batch.restart.GenericRestartData;
|
||||
@@ -367,7 +367,7 @@ public class StaxEventWriterItemWriter implements ItemWriter, ResourceLifecycle,
|
||||
* Write the value object to XML stream.
|
||||
*
|
||||
* @param output the value object
|
||||
* @see org.springframework.batch.io.ItemWriter#write(java.lang.Object)
|
||||
* @see org.springframework.batch.item.ItemWriter#write(java.lang.Object)
|
||||
*/
|
||||
public void write(Object output) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.springframework.batch.io.file.support.oxm;
|
||||
package org.springframework.batch.io.xml.oxm;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.stream.XMLEventWriter;
|
||||
import javax.xml.transform.Result;
|
||||
|
||||
import org.springframework.batch.io.file.support.stax.ObjectToXmlSerializer;
|
||||
import org.springframework.batch.io.xml.stax.ObjectToXmlSerializer;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.oxm.Marshaller;
|
||||
import org.springframework.xml.transform.StaxResult;
|
||||
@@ -1,10 +1,10 @@
|
||||
package org.springframework.batch.io.file.support.oxm;
|
||||
package org.springframework.batch.io.xml.oxm;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
|
||||
import org.springframework.batch.io.file.support.stax.FragmentDeserializer;
|
||||
import org.springframework.batch.io.xml.stax.FragmentDeserializer;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.oxm.Unmarshaller;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.namespace.NamespaceContext;
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventWriter;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventWriter;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io;
|
||||
package org.springframework.batch.item;
|
||||
|
||||
/**
|
||||
* Basic interface for generic output operations. Class implementing this
|
||||
@@ -2,9 +2,9 @@ package org.springframework.batch.item.processor;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.io.Skippable;
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.restart.GenericRestartData;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
import org.springframework.batch.restart.Restartable;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.batch.item.processor;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.DefaultFlatFileItemReader;
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.support.DefaultFlatFileItemReader;
|
||||
import org.springframework.batch.io.file.support.transform.LineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.LineTokenizer;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
@@ -24,7 +24,8 @@ import java.util.Collections;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.support.transform.Converter;
|
||||
import org.springframework.batch.io.file.FlatFileItemWriter;
|
||||
import org.springframework.batch.io.file.transform.Converter;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -22,8 +22,8 @@ import java.io.InputStream;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchEnvironmentException;
|
||||
import org.springframework.batch.io.file.support.ResourceLineReader;
|
||||
import org.springframework.batch.io.file.support.separator.SuffixRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.ResourceLineReader;
|
||||
import org.springframework.batch.io.file.separator.SuffixRecordSeparatorPolicy;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.file;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -24,11 +24,13 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchEnvironmentException;
|
||||
import org.springframework.batch.io.exception.FlatFileParsingException;
|
||||
import org.springframework.batch.io.file.DefaultFlatFileItemReader;
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.support.separator.DefaultRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.support.transform.LineTokenizer;
|
||||
import org.springframework.batch.io.file.SimpleFlatFileItemReader;
|
||||
import org.springframework.batch.io.file.separator.DefaultRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.LineTokenizer;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.mapping;
|
||||
package org.springframework.batch.io.file.mapping;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -25,6 +25,8 @@ import java.util.Properties;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.BeanWrapperFieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.BindingException;
|
||||
import org.springframework.batch.support.IntArrayPropertyEditor;
|
||||
import org.springframework.beans.BeanWrapperImpl;
|
||||
import org.springframework.beans.NotWritablePropertyException;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.mapping;
|
||||
package org.springframework.batch.io.file.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.support.mapping.PropertyMatches;
|
||||
import org.springframework.batch.io.file.mapping.PropertyMatches;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.mapping;
|
||||
package org.springframework.batch.io.file.mapping;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
import org.springframework.batch.io.file.support.separator.DefaultRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.separator.DefaultRecordSeparatorPolicy;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
import org.springframework.batch.io.file.support.separator.SimpleRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.separator.SimpleRecordSeparatorPolicy;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.separator;
|
||||
package org.springframework.batch.io.file.separator;
|
||||
|
||||
import org.springframework.batch.io.file.support.separator.SuffixRecordSeparatorPolicy;
|
||||
import org.springframework.batch.io.file.separator.SuffixRecordSeparatorPolicy;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.io.file.transform.AbstractLineTokenizer;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import org.springframework.batch.io.file.support.transform.DelimitedLineAggregator;
|
||||
import org.springframework.batch.io.file.transform.DelimitedLineAggregator;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.support.transform.AbstractLineTokenizer;
|
||||
import org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.AbstractLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.DelimitedLineTokenizer;
|
||||
|
||||
public class DelimitedLineTokenizerTests extends TestCase {
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import org.springframework.batch.io.file.support.transform.FixedLengthLineAggregator;
|
||||
import org.springframework.batch.io.file.transform.FixedLengthLineAggregator;
|
||||
import org.springframework.batch.io.file.transform.Range;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.support.transform.FixedLengthTokenizer;
|
||||
import org.springframework.batch.io.file.transform.FixedLengthTokenizer;
|
||||
import org.springframework.batch.io.file.transform.Range;
|
||||
|
||||
public class FixedLengthTokenizerTests extends TestCase {
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import org.springframework.batch.io.file.support.transform.LineAggregator;
|
||||
import org.springframework.batch.io.file.transform.LineAggregator;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -24,9 +24,9 @@ import java.util.Map;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.support.transform.LineTokenizer;
|
||||
import org.springframework.batch.io.file.support.transform.PrefixMatchingCompositeLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.DelimitedLineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.LineTokenizer;
|
||||
import org.springframework.batch.io.file.transform.PrefixMatchingCompositeLineTokenizer;
|
||||
|
||||
public class PrefixMatchingCompositeLineTokenizerTests extends TestCase {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.springframework.batch.io.file.support.transform;
|
||||
package org.springframework.batch.io.file.transform;
|
||||
|
||||
import org.springframework.batch.io.file.support.transform.Range;
|
||||
import org.springframework.batch.io.file.support.transform.RangeArrayPropertyEditor;
|
||||
import org.springframework.batch.io.file.transform.Range;
|
||||
import org.springframework.batch.io.file.transform.RangeArrayPropertyEditor;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.repeat.RepeatContext;
|
||||
import org.springframework.batch.repeat.RepeatInterceptor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.xml;
|
||||
|
||||
import javax.xml.stream.events.EndElement;
|
||||
import javax.xml.stream.events.StartElement;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.xml;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -15,8 +15,8 @@ import javax.xml.stream.events.XMLEvent;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.support.StaxEventReaderItemReader;
|
||||
import org.springframework.batch.io.file.support.stax.FragmentDeserializer;
|
||||
import org.springframework.batch.io.xml.StaxEventReaderItemReader;
|
||||
import org.springframework.batch.io.xml.stax.FragmentDeserializer;
|
||||
import org.springframework.batch.restart.GenericRestartData;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
import org.springframework.core.io.AbstractResource;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support;
|
||||
package org.springframework.batch.io.xml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -11,8 +11,8 @@ import javax.xml.transform.Result;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.springframework.batch.io.file.support.StaxEventWriterItemWriter;
|
||||
import org.springframework.batch.io.file.support.oxm.MarshallingObjectToXmlSerializer;
|
||||
import org.springframework.batch.io.xml.StaxEventWriterItemWriter;
|
||||
import org.springframework.batch.io.xml.oxm.MarshallingObjectToXmlSerializer;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.io.file.support.oxm;
|
||||
package org.springframework.batch.io.xml.oxm;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -26,7 +26,7 @@ import javax.xml.transform.Result;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.support.oxm.MarshallingObjectToXmlSerializer;
|
||||
import org.springframework.batch.io.xml.oxm.MarshallingObjectToXmlSerializer;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.oxm.Marshaller;
|
||||
import org.springframework.oxm.XmlMappingException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.oxm;
|
||||
package org.springframework.batch.io.xml.oxm;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.xml.stream.XMLInputFactory;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.file.support.oxm.UnmarshallingFragmentDeserializer;
|
||||
import org.springframework.batch.io.xml.oxm.UnmarshallingFragmentDeserializer;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
@@ -22,7 +22,7 @@ import javax.xml.stream.events.XMLEvent;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.file.support.stax.AbstractEventReaderWrapper;
|
||||
import org.springframework.batch.io.xml.stax.AbstractEventReaderWrapper;
|
||||
|
||||
import com.bea.xml.stream.events.StartDocumentEvent;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.namespace.NamespaceContext;
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
@@ -24,7 +24,7 @@ import javax.xml.stream.events.XMLEvent;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.file.support.stax.AbstractEventWriterWrapper;
|
||||
import org.springframework.batch.io.xml.stax.AbstractEventWriterWrapper;
|
||||
|
||||
import com.bea.xml.stream.events.StartDocumentEvent;
|
||||
import com.bea.xml.stream.util.NamespaceContextImpl;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
@@ -9,10 +9,10 @@ import javax.xml.stream.events.XMLEvent;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.support.EventHelper;
|
||||
import org.springframework.batch.io.file.support.stax.DefaultFragmentEventReader;
|
||||
import org.springframework.batch.io.file.support.stax.DefaultTransactionalEventReader;
|
||||
import org.springframework.batch.io.file.support.stax.FragmentEventReader;
|
||||
import org.springframework.batch.io.xml.EventHelper;
|
||||
import org.springframework.batch.io.xml.stax.DefaultFragmentEventReader;
|
||||
import org.springframework.batch.io.xml.stax.DefaultTransactionalEventReader;
|
||||
import org.springframework.batch.io.xml.stax.FragmentEventReader;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.support.EventHelper;
|
||||
import org.springframework.batch.io.file.support.stax.DefaultTransactionalEventReader;
|
||||
import org.springframework.batch.io.file.support.stax.TransactionalEventReader;
|
||||
import org.springframework.batch.io.xml.EventHelper;
|
||||
import org.springframework.batch.io.xml.stax.DefaultTransactionalEventReader;
|
||||
import org.springframework.batch.io.xml.stax.TransactionalEventReader;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventFactory;
|
||||
import javax.xml.stream.events.XMLEvent;
|
||||
|
||||
import org.springframework.batch.io.file.support.stax.EventSequence;
|
||||
import org.springframework.batch.io.xml.stax.EventSequence;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.io.file.support.stax;
|
||||
package org.springframework.batch.io.xml.stax;
|
||||
|
||||
import javax.xml.stream.XMLEventFactory;
|
||||
import javax.xml.stream.XMLEventWriter;
|
||||
@@ -7,7 +7,7 @@ import javax.xml.stream.events.XMLEvent;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.file.support.stax.NoStartEndDocumentStreamWriter;
|
||||
import org.springframework.batch.io.xml.stax.NoStartEndDocumentStreamWriter;
|
||||
|
||||
/**
|
||||
* Tests for {@link NoStartEndDocumentStreamWriter}
|
||||
@@ -21,8 +21,8 @@ import java.util.Properties;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.io.Skippable;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.processor.ItemWriterItemProcessor;
|
||||
import org.springframework.batch.restart.GenericRestartData;
|
||||
import org.springframework.batch.restart.RestartData;
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.springframework.batch.item.processor;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
|
||||
/**
|
||||
* Tests for {@link TransformerWriterItemProcessor}.
|
||||
|
||||
@@ -20,7 +20,7 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.FieldSet;
|
||||
import org.springframework.batch.io.file.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.support.SimpleFlatFileItemReader;
|
||||
import org.springframework.batch.io.file.SimpleFlatFileItemReader;
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
import org.springframework.batch.item.provider.DelegatingItemReader;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
<bean id="fieldSetMapper"
|
||||
class="org.springframework.batch.io.file.support.mapping.BeanWrapperFieldSetMapper">
|
||||
class="org.springframework.batch.io.file.mapping.BeanWrapperFieldSetMapper">
|
||||
<property name="prototypeBeanName" value="prototype"/>
|
||||
</bean>
|
||||
|
||||
<bean id="prototype" class="org.springframework.batch.io.file.support.mapping.TestObject" scope="prototype" />
|
||||
<bean id="prototype" class="org.springframework.batch.io.file.mapping.TestObject" scope="prototype" />
|
||||
|
||||
</beans>
|
||||
@@ -6,9 +6,9 @@ import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.io.file.support.StaxEventReaderItemReader;
|
||||
import org.springframework.batch.io.file.support.oxm.UnmarshallingFragmentDeserializer;
|
||||
import org.springframework.batch.io.oxm.domain.Trade;
|
||||
import org.springframework.batch.io.xml.StaxEventReaderItemReader;
|
||||
import org.springframework.batch.io.xml.oxm.UnmarshallingFragmentDeserializer;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.oxm.Unmarshaller;
|
||||
|
||||
@@ -11,9 +11,9 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.custommonkey.xmlunit.XMLAssert;
|
||||
import org.custommonkey.xmlunit.XMLUnit;
|
||||
import org.springframework.batch.io.file.support.StaxEventWriterItemWriter;
|
||||
import org.springframework.batch.io.file.support.oxm.MarshallingObjectToXmlSerializer;
|
||||
import org.springframework.batch.io.oxm.domain.Trade;
|
||||
import org.springframework.batch.io.xml.StaxEventWriterItemWriter;
|
||||
import org.springframework.batch.io.xml.oxm.MarshallingObjectToXmlSerializer;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.CustomerCredit;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.ResourceLifecycle;
|
||||
import org.springframework.batch.sample.domain.CustomerCredit;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.io.file.support.transform.Converter;
|
||||
import org.springframework.batch.io.file.transform.Converter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.Order;
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.CustomerCredit;
|
||||
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.Game;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.PlayerSummary;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.batch.io.file.support.transform.Converter;
|
||||
import org.springframework.batch.io.file.support.transform.LineAggregator;
|
||||
import org.springframework.batch.io.file.transform.Converter;
|
||||
import org.springframework.batch.io.file.transform.LineAggregator;
|
||||
import org.springframework.batch.sample.domain.Address;
|
||||
import org.springframework.batch.sample.domain.BillingInfo;
|
||||
import org.springframework.batch.sample.domain.Customer;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.Trade;
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.springframework.batch.sample.item.processor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.batch.io.ItemWriter;
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.CustomerCredit;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.batch.sample.item.processor;
|
||||
|
||||
import org.springframework.batch.io.file.support.FlatFileItemWriter;
|
||||
import org.springframework.batch.io.file.FlatFileItemWriter;
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
|
||||
public class DefaultFlatFileProcessor implements ItemProcessor{
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Properties;
|
||||
|
||||
import org.springframework.batch.core.tasklet.Tasklet;
|
||||
import org.springframework.batch.execution.tasklet.ItemOrientedTasklet;
|
||||
import org.springframework.batch.io.file.support.DefaultFlatFileItemReader;
|
||||
import org.springframework.batch.io.file.DefaultFlatFileItemReader;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.sample.dao.TradeWriter;
|
||||
import org.springframework.batch.sample.domain.Trade;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<!-- INFRASTRUCTURE SETUP -->
|
||||
|
||||
<bean id="fileInputTemplate" class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader"
|
||||
<bean id="fileInputTemplate" class="org.springframework.batch.io.file.DefaultFlatFileItemReader"
|
||||
scope="step" >
|
||||
<aop:scoped-proxy />
|
||||
<property name="resource" ref="fileLocator" />
|
||||
@@ -58,7 +58,7 @@
|
||||
<property name="fieldSetMapper" ref="fieldSetMapper" />
|
||||
</bean>
|
||||
|
||||
<bean id="fileInputTemplate2" class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader"
|
||||
<bean id="fileInputTemplate2" class="org.springframework.batch.io.file.DefaultFlatFileItemReader"
|
||||
scope="step">
|
||||
<aop:scoped-proxy />
|
||||
<property name="resource" ref="fileLocator2" />
|
||||
@@ -68,13 +68,13 @@
|
||||
</bean>
|
||||
|
||||
<bean id="fixedFileDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="names" value="ISIN,Quantity,price, CUSTOMER" />
|
||||
<property name="columns" value="1-12, 13-15, 16-20, 21-29" />
|
||||
</bean>
|
||||
|
||||
<bean id="fixedFileDescriptor2"
|
||||
class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="names" value="Title, FirstName, LastName, Age, Address.AddrLine1, children[0].name, children[1].name" />
|
||||
<property name="columns" value="1-5, 6-20, 21-40, 41-45, 46-55, 56-65, 66-75" />
|
||||
</bean>
|
||||
@@ -114,11 +114,11 @@
|
||||
value="data/beanWrapperMapperSampleJob/input/20070122.teststream.ImportPersonDataStep.txt" />
|
||||
</bean>
|
||||
|
||||
<bean id="fieldSetMapper" class="org.springframework.batch.io.file.support.mapping.BeanWrapperFieldSetMapper">
|
||||
<bean id="fieldSetMapper" class="org.springframework.batch.io.file.mapping.BeanWrapperFieldSetMapper">
|
||||
<property name="prototypeBeanName" value="trade"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fieldSetMapper2" class="org.springframework.batch.io.file.support.mapping.BeanWrapperFieldSetMapper">
|
||||
<bean id="fieldSetMapper2" class="org.springframework.batch.io.file.mapping.BeanWrapperFieldSetMapper">
|
||||
<property name="prototypeBeanName" value="person"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<!-- INFRASTRUCTURE SETUP -->
|
||||
|
||||
<bean id="fileInputTemplate" class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader"
|
||||
<bean id="fileInputTemplate" class="org.springframework.batch.io.file.DefaultFlatFileItemReader"
|
||||
scope="step">
|
||||
<aop:scoped-proxy />
|
||||
<property name="resource" ref="fileLocator" />
|
||||
@@ -54,7 +54,7 @@
|
||||
<property name="fieldSetMapper" ref="fieldSetMapper" />
|
||||
</bean>
|
||||
|
||||
<bean id="fixedFileDescriptor" class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
<bean id="fixedFileDescriptor" class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="names" value="ISIN, Quantity, Price, Customer" />
|
||||
<property name="columns" value="1-12, 13-15, 16-20, 21-29" />
|
||||
</bean>
|
||||
@@ -83,7 +83,7 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.batch.io.file.support.FlatFileItemWriter" id="flatFileOutputSource">
|
||||
<bean class="org.springframework.batch.io.file.FlatFileItemWriter" id="flatFileOutputSource">
|
||||
<property name="resource" ref="customerFileLocator" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- INFRASTRUCTURE SETUP -->
|
||||
|
||||
<!-- This input source is injected into the test case to verify the output - not used by the job at all -->
|
||||
<bean id="testInputTemplate" class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader">
|
||||
<bean id="testInputTemplate" class="org.springframework.batch.io.file.DefaultFlatFileItemReader">
|
||||
<property name="resource" ref="fileLocator" />
|
||||
<property name="tokenizer" ref="fixedFileDescriptor" />
|
||||
<property name="fieldSetMapper" ref="fieldSetMapper" />
|
||||
@@ -47,7 +47,7 @@
|
||||
<aop:scoped-proxy/>
|
||||
</bean>
|
||||
|
||||
<bean id="fixedFileDescriptor" class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
<bean id="fixedFileDescriptor" class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="names" value="ISIN, Quantity, Price, Customer" />
|
||||
<property name="columns" value="1-12, 13-15, 16-20, 21-29" />
|
||||
</bean>
|
||||
|
||||
@@ -96,12 +96,12 @@
|
||||
</bean>
|
||||
|
||||
<bean id="playerFileItemReader"
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader" scope="step">
|
||||
class="org.springframework.batch.io.file.DefaultFlatFileItemReader" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="resource" value="classpath:data/footballjob/input/player.csv" />
|
||||
<property name="tokenizer">
|
||||
<bean
|
||||
class="org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
|
||||
<property name="names"
|
||||
value="ID,lastName,firstName,position,birthYear,debutYear" />
|
||||
</bean>
|
||||
@@ -113,12 +113,12 @@
|
||||
</bean>
|
||||
|
||||
<bean id="gameFileItemReader"
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader" scope="step">
|
||||
class="org.springframework.batch.io.file.DefaultFlatFileItemReader" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="resource" value="classpath:data/footballjob/input/games.csv"/>
|
||||
<property name="tokenizer">
|
||||
<bean
|
||||
class="org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
|
||||
<property name="names"
|
||||
value="id,year,team,week,opponent,completes,attempts,passingYards,passingTd,interceptions,rushes,rushYards,receptions,receptionYards,totalTd" />
|
||||
</bean>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class="org.springframework.batch.sample.item.processor.DefaultFlatFileProcessor">
|
||||
<property name="flatFileOutputSource">
|
||||
<bean
|
||||
class="org.springframework.batch.io.file.support.FlatFileItemWriter"
|
||||
class="org.springframework.batch.io.file.FlatFileItemWriter"
|
||||
scope="step">
|
||||
<aop:scoped-proxy />
|
||||
<property name="resource"
|
||||
@@ -44,7 +44,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="fileItemReader"
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileItemReader"
|
||||
class="org.springframework.batch.io.file.DefaultFlatFileItemReader"
|
||||
scope="step">
|
||||
<aop:scoped-proxy />
|
||||
<property name="resource"
|
||||
@@ -58,7 +58,7 @@
|
||||
class="org.springframework.batch.sample.mapping.TradeFieldSetMapper" />
|
||||
|
||||
<bean id="fixedFileDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.PrefixMatchingCompositeLineTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.PrefixMatchingCompositeLineTokenizer">
|
||||
<property name="tokenizers">
|
||||
<map>
|
||||
<entry key="BEGIN" value-ref="beginRecordDescriptor" />
|
||||
@@ -69,17 +69,17 @@
|
||||
</bean>
|
||||
|
||||
<bean id="beginRecordDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="columns" value="1-5" />
|
||||
</bean>
|
||||
|
||||
<bean id="endRecordDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="columns" value="1-3" />
|
||||
</bean>
|
||||
|
||||
<bean id="tradeRecordDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="names" value="ISIN,Quantity,Price,Customer" />
|
||||
<property name="columns" value="1-12, 13-15, 16-20, 21-29" />
|
||||
</bean>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
<bean id="orderFileDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.PrefixMatchingCompositeLineTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.PrefixMatchingCompositeLineTokenizer">
|
||||
<property name="tokenizers">
|
||||
<map>
|
||||
<entry key="HEA" value-ref="headerRecordDescriptor" />
|
||||
@@ -22,12 +22,12 @@
|
||||
</bean>
|
||||
|
||||
<bean id="defaultLineDescriptor"
|
||||
class="org.springframework.batch.io.file.support.transform.FixedLengthTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.FixedLengthTokenizer">
|
||||
<property name="columns" value="1-120" />
|
||||
</bean>
|
||||
|
||||
<bean id="parentLineDescriptor" abstract="true"
|
||||
class="org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer">
|
||||
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
|
||||
<property name="delimiter" value=";"/>
|
||||
</bean>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user