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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user