From 14392bc51eaed85d28f798c9c331557c9d43c551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Garcia?= Date: Sun, 17 Jan 2016 04:13:00 -0200 Subject: [PATCH 1/4] Using modern Java APIs --- .../compiler/ParserFactorySupport.java | 4 +-- .../compiler/flat/FlatPreprocessor.java | 2 +- .../compiler/json/JsonParserFactory.java | 2 +- .../config/annotation/AnnotationParser.java | 2 +- .../DelimitedMarshallingContext.java | 2 +- .../FixedLengthMarshallingContext.java | 2 +- src/org/beanio/internal/util/DebugUtil.java | 12 +++------ src/org/beanio/internal/util/JsonUtil.java | 4 +-- .../parser/annotation/AnnotationTest.java | 8 +++--- .../json/segment/JsonSegmentParserTest.java | 2 +- test/org/beanio/parser/lazy/LazyTest.java | 2 +- .../parser/property/PropertyParserTest.java | 6 ++--- test/org/beanio/parser/target/TargetTest.java | 2 +- .../parser/template/TemplateParserTest.java | 6 ++--- test/org/beanio/parser/trim/TrimTest.java | 2 +- .../beanio/parser/types/TypesParserTest.java | 26 +++++++++---------- test/org/beanio/parser/xml/Person.java | 2 +- .../beanio/parser/xml/field/XmlFieldTest.java | 6 ++--- .../parser/xml/record/XmlRecordTest.java | 2 +- test/org/beanio/stream/JsonReaderTest.java | 8 +++--- .../types/CharacterTypeHandlerTest.java | 4 +-- 21 files changed, 51 insertions(+), 55 deletions(-) diff --git a/src/org/beanio/internal/compiler/ParserFactorySupport.java b/src/org/beanio/internal/compiler/ParserFactorySupport.java index ee62876..3025ee3 100644 --- a/src/org/beanio/internal/compiler/ParserFactorySupport.java +++ b/src/org/beanio/internal/compiler/ParserFactorySupport.java @@ -1527,7 +1527,7 @@ protected Property createProperty(PropertyConfig config) { if (config.getComponentType() == ComponentConfig.SEGMENT) { required = config.getMinOccurs() > 0 && !config.isNillable(); } - boolean matchNull = !required && new Integer(0).equals(config.getMinOccurs()); + boolean matchNull = !required && Integer.valueOf(0).equals(config.getMinOccurs()); CollectionBean collection = new CollectionBean(); collection.setName(config.getName()); @@ -1538,7 +1538,7 @@ protected Property createProperty(PropertyConfig config) { } else { boolean required = propertyStack.isEmpty(); - boolean matchNull = !required && new Integer(0).equals(config.getMinOccurs()); + boolean matchNull = !required && Integer.valueOf(0).equals(config.getMinOccurs()); Bean bean = new Bean(); bean.setName(config.getName()); diff --git a/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java b/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java index 1f96ae3..7fa2b96 100644 --- a/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java +++ b/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java @@ -360,7 +360,7 @@ else if (field.getLength() == null) { } } else { - if (new Integer(-1).equals(field.getLength())) { + if (Integer.valueOf(-1).equals(field.getLength())) { field.setLength(null); } } diff --git a/src/org/beanio/internal/compiler/json/JsonParserFactory.java b/src/org/beanio/internal/compiler/json/JsonParserFactory.java index d561132..9ea8dc4 100644 --- a/src/org/beanio/internal/compiler/json/JsonParserFactory.java +++ b/src/org/beanio/internal/compiler/json/JsonParserFactory.java @@ -147,7 +147,7 @@ protected FieldFormat createFieldFormat(FieldConfig config, Class type) { format.setJsonName(config.getJsonName()); format.setJsonArray(config.isJsonArray()); format.setJsonArrayIndex(config.getJsonArrayIndex()); - format.setLazy(config.getMinOccurs() != null && new Integer(0).equals(config.getMinOccurs())); + format.setLazy(config.getMinOccurs() != null && Integer.valueOf(0).equals(config.getMinOccurs())); format.setNillable(true); // for now, allow any JSON field to be nullable // default the JSON type based on the property type diff --git a/src/org/beanio/internal/config/annotation/AnnotationParser.java b/src/org/beanio/internal/config/annotation/AnnotationParser.java index 3d5dba7..795d3a1 100644 --- a/src/org/beanio/internal/config/annotation/AnnotationParser.java +++ b/src/org/beanio/internal/config/annotation/AnnotationParser.java @@ -754,7 +754,7 @@ private static Integer toUnboundedValue(int n) { if (val == null) { return null; } - if (val.compareTo(new Integer(0)) < 0) { + if (val.compareTo(Integer.valueOf(0)) < 0) { return Integer.MAX_VALUE; } return val; diff --git a/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java b/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java index 5679de4..5e58261 100644 --- a/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java @@ -142,7 +142,7 @@ public Entry(int position, String text) { } public int compareTo(Entry o) { - return new Integer(this.order).compareTo(o.order); + return Integer.valueOf(this.order).compareTo(o.order); } @Override diff --git a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java index 9bf1cf7..f020502 100644 --- a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java @@ -133,7 +133,7 @@ public Entry(int position, String text) { } public int compareTo(Entry o) { - return new Integer(this.order).compareTo(o.order); + return Integer.valueOf(this.order).compareTo(o.order); } @Override diff --git a/src/org/beanio/internal/util/DebugUtil.java b/src/org/beanio/internal/util/DebugUtil.java index 5e3d03f..d5bace5 100644 --- a/src/org/beanio/internal/util/DebugUtil.java +++ b/src/org/beanio/internal/util/DebugUtil.java @@ -1,6 +1,7 @@ package org.beanio.internal.util; import java.io.*; +import java.nio.charset.StandardCharsets; import org.beanio.internal.parser.format.FieldPadding; @@ -45,13 +46,8 @@ public static String formatPadding(FieldPadding padding) { } public static String toString(Debuggable c) { - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - c.debug(new PrintStream(out)); - return new String(out.toByteArray(), "ASCII"); - } - catch (UnsupportedEncodingException e) { - throw new IllegalStateException(e); - } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + c.debug(new PrintStream(out)); + return new String(out.toByteArray(), StandardCharsets.US_ASCII); } } diff --git a/src/org/beanio/internal/util/JsonUtil.java b/src/org/beanio/internal/util/JsonUtil.java index 84d4aad..2c0f64a 100644 --- a/src/org/beanio/internal/util/JsonUtil.java +++ b/src/org/beanio/internal/util/JsonUtil.java @@ -75,12 +75,12 @@ public static Number toNumber(String text) throws NumberFormatException { return d; } else if (text.length() < INT_SIZE) { - return new Integer(text); + return Integer.valueOf(text); } else { Long n = new Long(text); if (n.intValue() == n.longValue()) { - return new Integer(n.intValue()); + return Integer.valueOf(n.intValue()); } return n; } diff --git a/test/org/beanio/parser/annotation/AnnotationTest.java b/test/org/beanio/parser/annotation/AnnotationTest.java index bb5dc01..6e4b31b 100644 --- a/test/org/beanio/parser/annotation/AnnotationTest.java +++ b/test/org/beanio/parser/annotation/AnnotationTest.java @@ -113,13 +113,13 @@ public void testAnnotatedFields() { Assert.assertEquals("left", user.getHands()[0]); Assert.assertEquals("right", user.getHands()[1]); Assert.assertEquals(new GregorianCalendar(1970, 0, 1).getTime(), user.birthDate); - Assert.assertEquals(new Integer(28), user.getAge()); + Assert.assertEquals(Integer.valueOf(28), user.getAge()); Assert.assertEquals(2, user.letters.size()); - Assert.assertEquals(new Character('A'), user.letters.get(0)); - Assert.assertEquals(new Character('B'), user.letters.get(1)); + Assert.assertEquals(Character.valueOf('A'), user.letters.get(0)); + Assert.assertEquals(Character.valueOf('B'), user.letters.get(1)); Assert.assertEquals(1, user.numbers.size()); Assert.assertEquals(LinkedList.class, user.numbers.getClass()); - Assert.assertEquals(new Integer(1), user.numbers.get(0)); + Assert.assertEquals(Integer.valueOf(1), user.numbers.get(0)); Assert.assertEquals("END", user.end); Assert.assertEquals(input[i], m[i].marshal(user).toString()); diff --git a/test/org/beanio/parser/json/segment/JsonSegmentParserTest.java b/test/org/beanio/parser/json/segment/JsonSegmentParserTest.java index 2d01e22..a459a35 100644 --- a/test/org/beanio/parser/json/segment/JsonSegmentParserTest.java +++ b/test/org/beanio/parser/json/segment/JsonSegmentParserTest.java @@ -56,7 +56,7 @@ public void testSegment_JsonTypeObjectList() { try { Map map = (Map) in.read(); - assertEquals(new Integer(2), map.get("count")); + assertEquals(Integer.valueOf(2), map.get("count")); List list = (List) map.get("friends"); Person person = (Person) list.get(0); diff --git a/test/org/beanio/parser/lazy/LazyTest.java b/test/org/beanio/parser/lazy/LazyTest.java index f8670c1..7daae11 100644 --- a/test/org/beanio/parser/lazy/LazyTest.java +++ b/test/org/beanio/parser/lazy/LazyTest.java @@ -34,7 +34,7 @@ public void testLazySegment() { user = (LazyUser) u.unmarshal("kevin1 "); assertEquals("kevin", user.name); assertNotNull(user.account); - assertEquals(new Integer(1), user.account.getNumber()); + assertEquals(Integer.valueOf(1), user.account.getNumber()); assertEquals("", user.account.getText()); } diff --git a/test/org/beanio/parser/property/PropertyParserTest.java b/test/org/beanio/parser/property/PropertyParserTest.java index bdb39ba..b68f82c 100644 --- a/test/org/beanio/parser/property/PropertyParserTest.java +++ b/test/org/beanio/parser/property/PropertyParserTest.java @@ -46,7 +46,7 @@ public void testBasic() { try { Map map = (Map) in.read(); - assertEquals(new Integer(1), map.get("id")); + assertEquals(Integer.valueOf(1), map.get("id")); assertNull(map.get("recordType")); StringWriter text = new StringWriter(); @@ -61,8 +61,8 @@ public void testBasic() { assertEquals("Detail,John" + lineSeparator, text.toString()); map = (Map) in.read(); - assertEquals(new Integer(3), map.get("id")); - assertEquals(new Integer(1), map.get("recordCount")); + assertEquals(Integer.valueOf(3), map.get("id")); + assertEquals(Integer.valueOf(1), map.get("recordCount")); assertNull(map.get("recordType")); text = new StringWriter(); diff --git a/test/org/beanio/parser/target/TargetTest.java b/test/org/beanio/parser/target/TargetTest.java index 9fdcfa5..8918b6a 100644 --- a/test/org/beanio/parser/target/TargetTest.java +++ b/test/org/beanio/parser/target/TargetTest.java @@ -53,7 +53,7 @@ public void testTarget() { assertEquals("N,,kev,kevo", marshaller.marshal(list).toString()); Integer age = (Integer) unmarshaller.unmarshal("A,jen,28"); - assertEquals(new Integer(28), age); + assertEquals(Integer.valueOf(28), age); assertEquals("A,unknown,28", marshaller.marshal(age).toString()); } diff --git a/test/org/beanio/parser/template/TemplateParserTest.java b/test/org/beanio/parser/template/TemplateParserTest.java index 4e90d20..c613008 100644 --- a/test/org/beanio/parser/template/TemplateParserTest.java +++ b/test/org/beanio/parser/template/TemplateParserTest.java @@ -47,7 +47,7 @@ public void testRecordTemplate() { try { Map map = (Map) in.read(); - assertEquals(new Integer(1), map.get("id")); + assertEquals(Integer.valueOf(1), map.get("id")); assertEquals("joe", map.get("name")); assertEquals('M', map.get("gender")); } @@ -67,7 +67,7 @@ public void testBeanTemplate() { assertEquals('M', map.get("gender")); assertNotNull(map.get("bean")); map = (Map) map.get("bean"); - assertEquals(new Integer(1), map.get("id")); + assertEquals(Integer.valueOf(1), map.get("id")); assertEquals("joe", map.get("name")); } @@ -84,7 +84,7 @@ public void testIncludeTemplateFromRecord() { try { Map map = (Map) in.read(); - assertEquals(new Integer(1), map.get("id")); + assertEquals(Integer.valueOf(1), map.get("id")); assertEquals("joe", map.get("firstName")); assertEquals("smith", map.get("lastName")); assertEquals('M', map.get("gender")); diff --git a/test/org/beanio/parser/trim/TrimTest.java b/test/org/beanio/parser/trim/TrimTest.java index c4f9374..8c8c098 100644 --- a/test/org/beanio/parser/trim/TrimTest.java +++ b/test/org/beanio/parser/trim/TrimTest.java @@ -31,6 +31,6 @@ public void testLazySegment() { Map map = (Map) u.unmarshal("\"jen \",jen ,1 "); assertEquals("jen ", map.get("text")); assertEquals("jen", map.get("text_trim")); - assertEquals(new Integer(1), map.get("number")); + assertEquals(Integer.valueOf(1), map.get("number")); } } diff --git a/test/org/beanio/parser/types/TypesParserTest.java b/test/org/beanio/parser/types/TypesParserTest.java index 4779ad9..7a921f9 100644 --- a/test/org/beanio/parser/types/TypesParserTest.java +++ b/test/org/beanio/parser/types/TypesParserTest.java @@ -58,13 +58,13 @@ public void testObjectHandlers() throws Exception { try { ObjectRecord record; record = (ObjectRecord) in.read(); - assertEquals(new Byte((byte) 10), record.getByteValue()); - assertEquals(new Short((short) 10), record.getShortValue()); - assertEquals(new Integer(-10), record.getIntegerValue()); - assertEquals(new Long(10), record.getLongValue()); - assertEquals(new Float(10.1f), record.getFloatValue()); - assertEquals(new Double(-10.1), record.getDoubleValue()); - assertEquals(new Character('A'), record.getCharacterValue()); + assertEquals(Byte.valueOf((byte) 10), record.getByteValue()); + assertEquals(Short.valueOf((short) 10), record.getShortValue()); + assertEquals(Integer.valueOf(-10), record.getIntegerValue()); + assertEquals(Long.valueOf(10), record.getLongValue()); + assertEquals(Float.valueOf(10.1f), record.getFloatValue()); + assertEquals(Double.valueOf(-10.1), record.getDoubleValue()); + assertEquals(Character.valueOf('A'), record.getCharacterValue()); assertEquals("ABC", record.getStringValue()); assertEquals(new SimpleDateFormat("MMddyy").parse("010170"), record.getDateValue()); assertEquals(Boolean.TRUE, record.getBooleanValue()); @@ -240,12 +240,12 @@ public void testFormats() throws Exception { try { ObjectRecord record; record = (ObjectRecord) in.read(); - assertEquals(new Byte((byte)1), record.getByteValue()); - assertEquals(new Short((short)2), record.getShortValue()); - assertEquals(new Integer(-3), record.getIntegerValue()); - assertEquals(new Long(4), record.getLongValue()); - assertEquals(new Float("5.1"), record.getFloatValue()); - assertEquals(new Double("-6.1"), record.getDoubleValue()); + assertEquals(Byte.valueOf((byte)1), record.getByteValue()); + assertEquals(Short.valueOf((short)2), record.getShortValue()); + assertEquals(Integer.valueOf(-3), record.getIntegerValue()); + assertEquals(Long.valueOf(4), record.getLongValue()); + assertEquals(Float.valueOf("5.1"), record.getFloatValue()); + assertEquals(Double.valueOf("-6.1"), record.getDoubleValue()); assertEquals(sdf.parse("2011-01-01"), record.getDateValue()); assertEquals(new BigInteger("10"), record.getBigIntegerValue()); assertEquals(new BigDecimal("10.5"), record.getBigDecimalValue()); diff --git a/test/org/beanio/parser/xml/Person.java b/test/org/beanio/parser/xml/Person.java index 0ac7594..943005f 100644 --- a/test/org/beanio/parser/xml/Person.java +++ b/test/org/beanio/parser/xml/Person.java @@ -25,7 +25,7 @@ public class Person { /* used to test that the setter is not called for missing elements */ public static final String DEFAULT_NAME = new String(); - public static final Integer DEFAULT_AGE = new Integer(-1); + public static final Integer DEFAULT_AGE = Integer.valueOf(-1); private String type; private String gender; diff --git a/test/org/beanio/parser/xml/field/XmlFieldTest.java b/test/org/beanio/parser/xml/field/XmlFieldTest.java index 0d2d46f..16bad7f 100644 --- a/test/org/beanio/parser/xml/field/XmlFieldTest.java +++ b/test/org/beanio/parser/xml/field/XmlFieldTest.java @@ -49,7 +49,7 @@ public void testPaddingForOptionalField() throws Exception { BeanWriter out = factory.createWriter("stream", s); try { Person person = (Person) in.read(); - assertEquals(new Integer(25), person.getAge()); + assertEquals(Integer.valueOf(25), person.getAge()); out.write(person); person = (Person) in.read(); @@ -76,7 +76,7 @@ public void testPaddingForRequiredField() throws Exception { BeanWriter out = factory.createWriter("stream2", s); try { Person person = (Person) in.read(); - assertEquals(new Integer(25), person.getAge()); + assertEquals(Integer.valueOf(25), person.getAge()); out.write(person); assertFieldError(in, 5, "record", "age", "", "Required field not set"); @@ -105,7 +105,7 @@ public void testSetterNotCalledForMissingField() throws Exception { Person person = (Person) in.read(); assertEquals("Joe", person.getFirstName()); assertNull(person.getLastName()); - assertEquals(new Integer(10), person.getAge()); + assertEquals(Integer.valueOf(10), person.getAge()); person = (Person) in.read(); assertEquals("John", person.getFirstName()); diff --git a/test/org/beanio/parser/xml/record/XmlRecordTest.java b/test/org/beanio/parser/xml/record/XmlRecordTest.java index 496a01c..6f05418 100644 --- a/test/org/beanio/parser/xml/record/XmlRecordTest.java +++ b/test/org/beanio/parser/xml/record/XmlRecordTest.java @@ -55,7 +55,7 @@ public void testRecordClassIsCollection() throws Exception { List list = (List) in.read(); assertEquals("John", list.get(0)); assertNull(list.get(1)); - assertEquals(new Integer(22), list.get(2)); + assertEquals(Integer.valueOf(22), list.get(2)); out.write(list); out.close(); diff --git a/test/org/beanio/stream/JsonReaderTest.java b/test/org/beanio/stream/JsonReaderTest.java index c36c2ce..a965894 100644 --- a/test/org/beanio/stream/JsonReaderTest.java +++ b/test/org/beanio/stream/JsonReaderTest.java @@ -73,7 +73,7 @@ public void test_readNumber() throws IOException { map = in.read(); assertEquals(int1, map.get("int1")); map = in.read(); - assertEquals(new Integer(10), map.get("int2")); + assertEquals(Integer.valueOf(10), map.get("int2")); map = in.read(); assertEquals(long1, map.get("long1")); @@ -126,7 +126,7 @@ public void test_readObject() throws IOException { Map object; Map map = in.read(); - assertEquals(new Integer(20), map.get("field2")); + assertEquals(Integer.valueOf(20), map.get("field2")); object = (Map) map.get("o1"); assertEquals("value1", object.get("field1")); @@ -137,7 +137,7 @@ public void test_readObject() throws IOException { map = in.read(); object = (Map) map.get("o1"); assertEquals("value1", object.get("field1")); - assertEquals(new Integer(10), object.get("field2")); + assertEquals(Integer.valueOf(10), object.get("field2")); assertNull(in.read()); } @@ -190,7 +190,7 @@ public void test_mixedArray() throws IOException { "{ \"array\" : [ [10], { \"field\":\"value\" } ]}"); List list = (List) ((List)map.get("array")).get(0); - assertEquals(new Integer(10), list.get(0)); + assertEquals(Integer.valueOf(10), list.get(0)); map = (Map) ((List)map.get("array")).get(1); assertEquals("value", map.get("field")); diff --git a/test/org/beanio/types/CharacterTypeHandlerTest.java b/test/org/beanio/types/CharacterTypeHandlerTest.java index 1c50af1..2ac4c34 100644 --- a/test/org/beanio/types/CharacterTypeHandlerTest.java +++ b/test/org/beanio/types/CharacterTypeHandlerTest.java @@ -30,7 +30,7 @@ public class CharacterTypeHandlerTest { @Test public void testParse() throws TypeConversionException { CharacterTypeHandler handler = new CharacterTypeHandler(); - assertEquals(new Character('V'), handler.parse("V")); + assertEquals(Character.valueOf('V'), handler.parse("V")); assertNull(handler.parse(null)); assertNull(handler.parse("")); } @@ -44,7 +44,7 @@ public void testParseInvalid() throws TypeConversionException { @Test public void testFormat() throws TypeConversionException { CharacterTypeHandler handler = new CharacterTypeHandler(); - assertEquals("V", handler.format(new Character('V'))); + assertEquals("V", handler.format(Character.valueOf('V'))); assertEquals("", handler.format("")); assertNull(handler.format(null)); } From 92c5caa772f2d5d71a0f1ac44472d269e3b5d22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Garcia?= Date: Sun, 17 Jan 2016 04:25:15 -0200 Subject: [PATCH 2/4] Using diamond operator when possible --- src/org/beanio/builder/CsvParserBuilder.java | 2 +- src/org/beanio/builder/DelimitedParserBuilder.java | 2 +- src/org/beanio/builder/FixedLengthParserBuilder.java | 2 +- src/org/beanio/builder/StreamBuilder.java | 2 +- src/org/beanio/builder/XmlParserBuilder.java | 2 +- src/org/beanio/internal/DefaultStreamFactory.java | 2 +- .../beanio/internal/compiler/ParserFactorySupport.java | 6 +++--- src/org/beanio/internal/compiler/ProcessorSupport.java | 2 +- src/org/beanio/internal/compiler/StreamCompiler.java | 6 +++--- .../internal/compiler/flat/FlatParserFactory.java | 2 +- .../internal/compiler/flat/FlatPreprocessor.java | 6 +++--- src/org/beanio/internal/config/BeanIOConfig.java | 4 ++-- src/org/beanio/internal/config/SegmentConfig.java | 2 +- src/org/beanio/internal/config/StreamConfig.java | 2 +- src/org/beanio/internal/config/xml/XmlMapping.java | 4 ++-- .../beanio/internal/config/xml/XmlMappingParser.java | 8 ++++---- .../beanio/internal/config/xml/XmlMappingReader.java | 2 +- src/org/beanio/internal/parser/Aggregation.java | 2 +- src/org/beanio/internal/parser/ArrayParser.java | 4 ++-- src/org/beanio/internal/parser/CollectionParser.java | 2 +- src/org/beanio/internal/parser/ErrorContext.java | 10 +++++----- src/org/beanio/internal/parser/Group.java | 4 ++-- src/org/beanio/internal/parser/MapParser.java | 2 +- src/org/beanio/internal/parser/ParsingContext.java | 2 +- src/org/beanio/internal/parser/Record.java | 2 +- src/org/beanio/internal/parser/RecordArray.java | 4 ++-- src/org/beanio/internal/parser/Segment.java | 2 +- .../beanio/internal/parser/UnmarshallingContext.java | 2 +- .../format/delimited/DelimitedMarshallingContext.java | 4 ++-- .../fixedlength/FixedLengthMarshallingContext.java | 2 +- .../parser/format/json/JsonMarshallingContext.java | 6 +++--- .../internal/parser/format/xml/XmlSelectorWrapper.java | 2 +- .../parser/format/xml/XmlUnmarshallingContext.java | 2 +- .../parser/message/ResourceBundleMessageFactory.java | 2 +- src/org/beanio/internal/util/BeanUtil.java | 2 +- src/org/beanio/internal/util/Replicator.java | 4 ++-- src/org/beanio/internal/util/ReplicatorTest.java | 2 +- .../beanio/internal/util/ToStringEnumTypeHandler.java | 2 +- src/org/beanio/internal/util/TreeNode.java | 8 ++++---- src/org/beanio/internal/util/TypeHandlerFactory.java | 2 +- src/org/beanio/stream/csv/CsvReader.java | 2 +- src/org/beanio/stream/csv/CsvRecordParser.java | 2 +- src/org/beanio/stream/delimited/DelimitedReader.java | 2 +- .../beanio/stream/delimited/DelimitedRecordParser.java | 2 +- src/org/beanio/stream/json/JsonReaderSupport.java | 4 ++-- src/org/beanio/stream/xml/ElementStack.java | 2 +- src/org/beanio/stream/xml/XmlParserConfiguration.java | 2 +- src/org/beanio/stream/xml/XmlRecordMarshaller.java | 4 ++-- src/org/beanio/stream/xml/XmlWriter.java | 6 +++--- test/org/beanio/parser/bean/BeanParserTest.java | 2 +- test/org/beanio/parser/bean/Widget.java | 2 +- .../parser/collection/CollectionFieldParserTest.java | 2 +- 52 files changed, 81 insertions(+), 81 deletions(-) diff --git a/src/org/beanio/builder/CsvParserBuilder.java b/src/org/beanio/builder/CsvParserBuilder.java index a451067..9f53b49 100644 --- a/src/org/beanio/builder/CsvParserBuilder.java +++ b/src/org/beanio/builder/CsvParserBuilder.java @@ -79,7 +79,7 @@ public CsvParserBuilder alwaysQuote() throws BeanIOConfigurationException { @Override public BeanConfig build() { - BeanConfig config = new BeanConfig(); + BeanConfig config = new BeanConfig<>(); config.setInstance(parser); return config; } diff --git a/src/org/beanio/builder/DelimitedParserBuilder.java b/src/org/beanio/builder/DelimitedParserBuilder.java index af66b97..d173307 100644 --- a/src/org/beanio/builder/DelimitedParserBuilder.java +++ b/src/org/beanio/builder/DelimitedParserBuilder.java @@ -62,7 +62,7 @@ public DelimitedParserBuilder enableComments(String... comments) { @Override public BeanConfig build() { - BeanConfig config = new BeanConfig(); + BeanConfig config = new BeanConfig<>(); config.setInstance(parser); return config; } diff --git a/src/org/beanio/builder/FixedLengthParserBuilder.java b/src/org/beanio/builder/FixedLengthParserBuilder.java index 2a1cb67..fbfd6ed 100644 --- a/src/org/beanio/builder/FixedLengthParserBuilder.java +++ b/src/org/beanio/builder/FixedLengthParserBuilder.java @@ -66,7 +66,7 @@ public FixedLengthParserBuilder enableComments(String... comments) { @Override public BeanConfig build() { - BeanConfig config = new BeanConfig(); + BeanConfig config = new BeanConfig<>(); config.setInstance(parser); return config; } diff --git a/src/org/beanio/builder/StreamBuilder.java b/src/org/beanio/builder/StreamBuilder.java index f0f0ebe..810d97f 100644 --- a/src/org/beanio/builder/StreamBuilder.java +++ b/src/org/beanio/builder/StreamBuilder.java @@ -76,7 +76,7 @@ public StreamBuilder format(String format) { * @return this */ public StreamBuilder parser(RecordParserFactory parser) { - BeanConfig bc = new BeanConfig(); + BeanConfig bc = new BeanConfig<>(); bc.setInstance(parser); config.setParserFactory(bc); return this; diff --git a/src/org/beanio/builder/XmlParserBuilder.java b/src/org/beanio/builder/XmlParserBuilder.java index 3e94ee0..08db350 100644 --- a/src/org/beanio/builder/XmlParserBuilder.java +++ b/src/org/beanio/builder/XmlParserBuilder.java @@ -70,7 +70,7 @@ public XmlParserBuilder lineSeparator(String sep) { @Override public BeanConfig build() { - BeanConfig config = new BeanConfig(); + BeanConfig config = new BeanConfig<>(); config.setInstance(parser); return config; } diff --git a/src/org/beanio/internal/DefaultStreamFactory.java b/src/org/beanio/internal/DefaultStreamFactory.java index a5156d5..09814f2 100644 --- a/src/org/beanio/internal/DefaultStreamFactory.java +++ b/src/org/beanio/internal/DefaultStreamFactory.java @@ -35,7 +35,7 @@ public class DefaultStreamFactory extends StreamFactory { private StreamCompiler compiler; - private Map contextMap = new ConcurrentHashMap(); + private Map contextMap = new ConcurrentHashMap<>(); /** * Constructs a new DefaultStreamFactory. diff --git a/src/org/beanio/internal/compiler/ParserFactorySupport.java b/src/org/beanio/internal/compiler/ParserFactorySupport.java index 3025ee3..ff7638f 100644 --- a/src/org/beanio/internal/compiler/ParserFactorySupport.java +++ b/src/org/beanio/internal/compiler/ParserFactorySupport.java @@ -62,8 +62,8 @@ public abstract class ParserFactorySupport extends ProcessorSupport implements P private PropertyAccessorFactory accessorFactory; private ClassLoader classLoader; - private LinkedList parserStack = new LinkedList(); - private LinkedList propertyStack = new LinkedList(); + private LinkedList parserStack = new LinkedList<>(); + private LinkedList propertyStack = new LinkedList<>(); /** * Constructs a new ParserFactory. @@ -232,7 +232,7 @@ protected void updateConstructor(Bean bean) { if (property.getAccessor().isConstructorArgument()) { if (args == null) { - args = new ArrayList(); + args = new ArrayList<>(); } args.add(property); } diff --git a/src/org/beanio/internal/compiler/ProcessorSupport.java b/src/org/beanio/internal/compiler/ProcessorSupport.java index 72d9c3f..991b9a8 100644 --- a/src/org/beanio/internal/compiler/ProcessorSupport.java +++ b/src/org/beanio/internal/compiler/ProcessorSupport.java @@ -30,7 +30,7 @@ */ public abstract class ProcessorSupport { - private LinkedList configStack = new LinkedList(); + private LinkedList configStack = new LinkedList<>(); /** * Constructs a new ProcessorSupport. diff --git a/src/org/beanio/internal/compiler/StreamCompiler.java b/src/org/beanio/internal/compiler/StreamCompiler.java index baebd98..f911a87 100644 --- a/src/org/beanio/internal/compiler/StreamCompiler.java +++ b/src/org/beanio/internal/compiler/StreamCompiler.java @@ -87,7 +87,7 @@ public Collection loadMapping(InputStream in, Properties properties) thr } // check for duplicate stream names... - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); for (BeanIOConfig config : configList) { for (StreamConfig streamConfig : config.getStreamList()) { if (!set.add(streamConfig.getName())) { @@ -103,7 +103,7 @@ public Collection loadMapping(InputStream in, Properties properties) thr return createStreamDefinitions(configList.iterator().next()); } else { - List list = new ArrayList(); + List list = new ArrayList<>(); for (BeanIOConfig config : configList) { list.addAll(createStreamDefinitions(config)); } @@ -135,7 +135,7 @@ protected Collection createStreamDefinitions(BeanIOConfig config) config.getTypeHandlerList()); Collection streamConfigList = config.getStreamList(); - Collection streamDefinitionList = new ArrayList(streamConfigList.size()); + Collection streamDefinitionList = new ArrayList<>(streamConfigList.size()); for (StreamConfig streamConfig : streamConfigList) { diff --git a/src/org/beanio/internal/compiler/flat/FlatParserFactory.java b/src/org/beanio/internal/compiler/flat/FlatParserFactory.java index 1042fde..3ded981 100644 --- a/src/org/beanio/internal/compiler/flat/FlatParserFactory.java +++ b/src/org/beanio/internal/compiler/flat/FlatParserFactory.java @@ -47,7 +47,7 @@ protected void finalizeRecord(RecordConfig config, Record record) { @SuppressWarnings("unused") private static class NodeComparator implements Comparator { - private IdentityHashMap cache = new IdentityHashMap(); + private IdentityHashMap cache = new IdentityHashMap<>(); /* * (non-Javadoc) diff --git a/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java b/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java index 7fa2b96..eb060db 100644 --- a/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java +++ b/src/org/beanio/internal/compiler/flat/FlatPreprocessor.java @@ -42,11 +42,11 @@ public class FlatPreprocessor extends Preprocessor { // the component that immediately follows the unbounded component private PropertyConfig unboundedComponentFollower = null; // the list of components at the end of the record following the unbounded component - private List endComponents = new ArrayList(); + private List endComponents = new ArrayList<>(); /* stack of non-record segments */ - private LinkedList segmentStack = new LinkedList(); + private LinkedList segmentStack = new LinkedList<>(); /* list of field components belonging to a record, used for validating dynamic occurrences */ - private List fieldComponents = new ArrayList(); + private List fieldComponents = new ArrayList<>(); /** * Constructs a new FlatPreprocessor. diff --git a/src/org/beanio/internal/config/BeanIOConfig.java b/src/org/beanio/internal/config/BeanIOConfig.java index d553ad6..347e8f5 100644 --- a/src/org/beanio/internal/config/BeanIOConfig.java +++ b/src/org/beanio/internal/config/BeanIOConfig.java @@ -26,8 +26,8 @@ public class BeanIOConfig implements Cloneable { private String source; - private List streamList = new ArrayList(); - private List handlerList = new ArrayList(); + private List streamList = new ArrayList<>(); + private List handlerList = new ArrayList<>(); /** * Constructs a new BeanIOConfig. diff --git a/src/org/beanio/internal/config/SegmentConfig.java b/src/org/beanio/internal/config/SegmentConfig.java index 3bb0853..7b869c3 100644 --- a/src/org/beanio/internal/config/SegmentConfig.java +++ b/src/org/beanio/internal/config/SegmentConfig.java @@ -62,7 +62,7 @@ public char getComponentType() { * @return list of children */ public List getPropertyList() { - List list = new ArrayList(getChildren().size()); + List list = new ArrayList<>(getChildren().size()); toPropertyList(this, list); return list; } diff --git a/src/org/beanio/internal/config/StreamConfig.java b/src/org/beanio/internal/config/StreamConfig.java index bbf1fac..9c7856c 100644 --- a/src/org/beanio/internal/config/StreamConfig.java +++ b/src/org/beanio/internal/config/StreamConfig.java @@ -45,7 +45,7 @@ public class StreamConfig extends GroupConfig { private boolean strict = false; private boolean ignoreUnidentifiedRecords = false; - private List handlerList = new ArrayList(); + private List handlerList = new ArrayList<>(); private BeanConfig parserFactory; /** diff --git a/src/org/beanio/internal/config/xml/XmlMapping.java b/src/org/beanio/internal/config/xml/XmlMapping.java index 643133f..b878fa8 100644 --- a/src/org/beanio/internal/config/xml/XmlMapping.java +++ b/src/org/beanio/internal/config/xml/XmlMapping.java @@ -35,8 +35,8 @@ public class XmlMapping { private XmlMapping parent; private Properties properties; private BeanIOConfig config = new BeanIOConfig(); - private List importList = new LinkedList(); - private Map templateMap = new HashMap(); + private List importList = new LinkedList<>(); + private Map templateMap = new HashMap<>(); /** * Constructs a new XmlMapping. diff --git a/src/org/beanio/internal/config/xml/XmlMappingParser.java b/src/org/beanio/internal/config/xml/XmlMappingParser.java index 58938e3..6a71f50 100644 --- a/src/org/beanio/internal/config/xml/XmlMappingParser.java +++ b/src/org/beanio/internal/config/xml/XmlMappingParser.java @@ -54,7 +54,7 @@ public class XmlMappingParser implements StringUtil.PropertySource { /* whether the current record class was annotated */ private transient boolean annotatedRecord = false; - private LinkedList includeStack = new LinkedList(); + private LinkedList includeStack = new LinkedList<>(); /** * Constructs a new XmlMappingParser. @@ -86,7 +86,7 @@ public Collection loadConfiguration(InputStream in, Properties pro this.properties = properties; mapping = new XmlMapping(); - mappings = new HashMap(); + mappings = new HashMap<>(); mappings.put("[root]", mapping); try { @@ -100,13 +100,13 @@ public Collection loadConfiguration(InputStream in, Properties pro throw ex; } - List configList = new ArrayList(mappings.size()); + List configList = new ArrayList<>(mappings.size()); for (XmlMapping m : mappings.values()) { BeanIOConfig config = m.getConfiguration().clone(); // global type handlers are the only elements that need to be imported // from other mapping files - List handlerList = new ArrayList(); + List handlerList = new ArrayList<>(); m.addTypeHandlers(handlerList); config.setTypeHandlerList(handlerList); diff --git a/src/org/beanio/internal/config/xml/XmlMappingReader.java b/src/org/beanio/internal/config/xml/XmlMappingReader.java index cebcd66..a5531a1 100644 --- a/src/org/beanio/internal/config/xml/XmlMappingReader.java +++ b/src/org/beanio/internal/config/xml/XmlMappingReader.java @@ -65,7 +65,7 @@ public Document loadDocument(InputStream in) throws IOException, DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(createEntityResolver()); - final List errorMessages = new ArrayList(); + final List errorMessages = new ArrayList<>(); builder.setErrorHandler(new ErrorHandler() { public void warning(SAXParseException exception) throws SAXException { diff --git a/src/org/beanio/internal/parser/Aggregation.java b/src/org/beanio/internal/parser/Aggregation.java index 34109d1..21b7ae7 100644 --- a/src/org/beanio/internal/parser/Aggregation.java +++ b/src/org/beanio/internal/parser/Aggregation.java @@ -40,7 +40,7 @@ public abstract class Aggregation extends DelegatingParser implements Property, protected Field occurs; // the current iteration index - private ParserLocal index = new ParserLocal(); + private ParserLocal index = new ParserLocal<>(); /** * Constructs a new Aggregation. diff --git a/src/org/beanio/internal/parser/ArrayParser.java b/src/org/beanio/internal/parser/ArrayParser.java index a20e575..11b1463 100644 --- a/src/org/beanio/internal/parser/ArrayParser.java +++ b/src/org/beanio/internal/parser/ArrayParser.java @@ -70,7 +70,7 @@ public void setValue(ParsingContext context, Object value) { if (value != null) { int length = Array.getLength(value); if (length > 0) { - collection = new ArrayList(length); + collection = new ArrayList<>(length); for (int i=0; i createCollection() { - return new ArrayList(); + return new ArrayList<>(); } public Class getArrayType() { diff --git a/src/org/beanio/internal/parser/CollectionParser.java b/src/org/beanio/internal/parser/CollectionParser.java index 330392a..4865df6 100644 --- a/src/org/beanio/internal/parser/CollectionParser.java +++ b/src/org/beanio/internal/parser/CollectionParser.java @@ -34,7 +34,7 @@ public class CollectionParser extends Aggregation { // the collection type private Class> type; // the property value - private ParserLocal value = new ParserLocal(); + private ParserLocal value = new ParserLocal<>(); /** * Constructs a new CollectionParser. diff --git a/src/org/beanio/internal/parser/ErrorContext.java b/src/org/beanio/internal/parser/ErrorContext.java index 979f76e..38d29db 100644 --- a/src/org/beanio/internal/parser/ErrorContext.java +++ b/src/org/beanio/internal/parser/ErrorContext.java @@ -138,11 +138,11 @@ public void setRecordName(String recordName) { */ public void addFieldError(String fieldName, String message) { if (fieldErrorMap == null) { - fieldErrorMap = new HashMap>(); + fieldErrorMap = new HashMap<>(); } Collection errors = fieldErrorMap.get(fieldName); if (errors == null) { - errors = new ArrayList(); + errors = new ArrayList<>(); errors.add(message); fieldErrorMap.put(fieldName, errors); } @@ -157,7 +157,7 @@ public void addFieldError(String fieldName, String message) { */ public void addRecordError(String message) { if (recordErrors == null) { - recordErrors = new ArrayList(3); + recordErrors = new ArrayList<>(3); } recordErrors.add(message); } @@ -170,13 +170,13 @@ public void addRecordError(String message) { */ public void setFieldText(String fieldName, String text, boolean repeating) { if (fieldTextMap == null) { - fieldTextMap = new HashMap(); + fieldTextMap = new HashMap<>(); } if (repeating) { // update the field count if (fieldCountMap == null) { - fieldCountMap = new HashMap(); + fieldCountMap = new HashMap<>(); } Counter counter = fieldCountMap.get(fieldName); diff --git a/src/org/beanio/internal/parser/Group.java b/src/org/beanio/internal/parser/Group.java index f139ae0..b2e573d 100644 --- a/src/org/beanio/internal/parser/Group.java +++ b/src/org/beanio/internal/parser/Group.java @@ -39,9 +39,9 @@ public class Group extends ParserComponent implements Selector { private int order = 1; private Property property = null; // the current group count - private ParserLocal count = new ParserLocal(0); + private ParserLocal count = new ParserLocal<>(0); // the last matched child - private ParserLocal lastMatched = new ParserLocal(); + private ParserLocal lastMatched = new ParserLocal<>(); /** * Constructs a new Group. diff --git a/src/org/beanio/internal/parser/MapParser.java b/src/org/beanio/internal/parser/MapParser.java index 64a8e28..45137e2 100644 --- a/src/org/beanio/internal/parser/MapParser.java +++ b/src/org/beanio/internal/parser/MapParser.java @@ -34,7 +34,7 @@ public class MapParser extends Aggregation { // the child property used for the key private Property key; // the property value - private ParserLocal value = new ParserLocal(); + private ParserLocal value = new ParserLocal<>(); /** * Constructs a new MapParser. diff --git a/src/org/beanio/internal/parser/ParsingContext.java b/src/org/beanio/internal/parser/ParsingContext.java index 345a3b5..42e894b 100644 --- a/src/org/beanio/internal/parser/ParsingContext.java +++ b/src/org/beanio/internal/parser/ParsingContext.java @@ -32,7 +32,7 @@ public abstract class ParsingContext { private int fieldOffset = 0; private Object[] localHeap; - private ArrayList iterationStack = new ArrayList(); + private ArrayList iterationStack = new ArrayList<>(); /** * Constructs a new ParsingContext. diff --git a/src/org/beanio/internal/parser/Record.java b/src/org/beanio/internal/parser/Record.java index cff2c5d..6d895f7 100644 --- a/src/org/beanio/internal/parser/Record.java +++ b/src/org/beanio/internal/parser/Record.java @@ -36,7 +36,7 @@ public class Record extends Segment implements Selector { // the record format private RecordFormat format; // current record count - private ParserLocal count = new ParserLocal(0); + private ParserLocal count = new ParserLocal<>(0); /** * Constructs a new Record. diff --git a/src/org/beanio/internal/parser/RecordArray.java b/src/org/beanio/internal/parser/RecordArray.java index 3fe7c05..4d3f32d 100644 --- a/src/org/beanio/internal/parser/RecordArray.java +++ b/src/org/beanio/internal/parser/RecordArray.java @@ -69,7 +69,7 @@ public void setValue(ParsingContext context, Object value) { if (value != null) { int length = Array.getLength(value); if (length > 0) { - collection = new ArrayList(length); + collection = new ArrayList<>(length); for (int i=0; i createAggregationType() { - return new ArrayList(); + return new ArrayList<>(); } /** diff --git a/src/org/beanio/internal/parser/Segment.java b/src/org/beanio/internal/parser/Segment.java index 611f5db..35cc872 100644 --- a/src/org/beanio/internal/parser/Segment.java +++ b/src/org/beanio/internal/parser/Segment.java @@ -51,7 +51,7 @@ public class Segment extends ParserComponent { // temporarily stores missing children during unmarshalling private ParserLocal> missing = new ParserLocal>() { protected List createDefaultValue() { - return new ArrayList(); + return new ArrayList<>(); } }; diff --git a/src/org/beanio/internal/parser/UnmarshallingContext.java b/src/org/beanio/internal/parser/UnmarshallingContext.java index 9f8c831..1601438 100644 --- a/src/org/beanio/internal/parser/UnmarshallingContext.java +++ b/src/org/beanio/internal/parser/UnmarshallingContext.java @@ -57,7 +57,7 @@ public abstract class UnmarshallingContext extends ParsingContext { // indicates the record context was queried and must therefore be recreated when the next record is read private boolean dirty; // a list of record contexts (for parsing record groups) - private List recordList = new ArrayList(); + private List recordList = new ArrayList<>(); /** * Constructs a new UnmarshallingContext. diff --git a/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java b/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java index 5e58261..24d4bfc 100644 --- a/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java @@ -30,9 +30,9 @@ public class DelimitedMarshallingContext extends MarshallingContext { // the index of the last committed field in the record private int committed = 0; // the list used to build the final record - private ArrayList record = new ArrayList(); + private ArrayList record = new ArrayList<>(); // the list of entries for creating the record (may be unordered) - private ArrayList entries = new ArrayList(); + private ArrayList entries = new ArrayList<>(); /** * Constructs a new DelimitedMarshallingContext. diff --git a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java index f020502..a244914 100644 --- a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java @@ -33,7 +33,7 @@ public class FixedLengthMarshallingContext extends MarshallingContext { // appending the last required field private int committed = 0; // the list of entries for creating the record (may be unordered) - private ArrayList entries = new ArrayList(); + private ArrayList entries = new ArrayList<>(); /** * Constructs a new FixedLengthMarshallingContext. diff --git a/src/org/beanio/internal/parser/format/json/JsonMarshallingContext.java b/src/org/beanio/internal/parser/format/json/JsonMarshallingContext.java index 7ca7250..1cede19 100644 --- a/src/org/beanio/internal/parser/format/json/JsonMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/json/JsonMarshallingContext.java @@ -61,7 +61,7 @@ public void push(JsonNode type) { value = new LinkedHashMap(); } else { // array - value = new ArrayList(); + value = new ArrayList<>(); } put(type, value); @@ -99,14 +99,14 @@ public void put(JsonNode type, Object value) { list = (List) list().get(index); } else { - list = new ArrayList(); + list = new ArrayList<>(); list().add(list); } } else { // object list = (List) map().get(type.getJsonName()); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); map().put(type.getJsonName(), list); } } diff --git a/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java b/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java index aff2654..a92d92e 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java +++ b/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java @@ -34,7 +34,7 @@ public class XmlSelectorWrapper extends ParserComponent implements Selector, Xml private static final String WRITTEN_KEY = "written"; /* state attributes */ - private ParserLocal written = new ParserLocal(false); + private ParserLocal written = new ParserLocal<>(false); /* marshalling flags */ private boolean group; diff --git a/src/org/beanio/internal/parser/format/xml/XmlUnmarshallingContext.java b/src/org/beanio/internal/parser/format/xml/XmlUnmarshallingContext.java index 8bf38a8..0d007bb 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlUnmarshallingContext.java +++ b/src/org/beanio/internal/parser/format/xml/XmlUnmarshallingContext.java @@ -35,7 +35,7 @@ public class XmlUnmarshallingContext extends UnmarshallingContext { /* The last parsed node in the document, which is the parent node of the next field/bean to parse */ private Element position; /* This stack of elements is used to store the last XML node parsed for a field or bean collection. */ - private LinkedList elementStack = new LinkedList(); + private LinkedList elementStack = new LinkedList<>(); /* Store previously matched groups for parsing subsequent records in a record group */ private XmlNode[] groupStack; diff --git a/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java b/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java index b2982bb..1b00afd 100644 --- a/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java +++ b/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java @@ -37,7 +37,7 @@ public class ResourceBundleMessageFactory implements MessageFactory { /* default resource bundle for messages based on the stream format */ private ResourceBundle defaultResourceBundle; /* cache messages from resource bundles */ - private ConcurrentHashMap messageCache = new ConcurrentHashMap(); + private ConcurrentHashMap messageCache = new ConcurrentHashMap<>(); /* used to flag cache misses */ private static final String NOT_FOUND = new String(); diff --git a/src/org/beanio/internal/util/BeanUtil.java b/src/org/beanio/internal/util/BeanUtil.java index 57c81d4..3786b33 100644 --- a/src/org/beanio/internal/util/BeanUtil.java +++ b/src/org/beanio/internal/util/BeanUtil.java @@ -330,7 +330,7 @@ public String[] parse(String text) throws TypeConversionException { boolean escaped = false; StringBuilder item = new StringBuilder(); - List list = new ArrayList(); + List list = new ArrayList<>(); char[] ca = text.toCharArray(); for (char c : ca) { diff --git a/src/org/beanio/internal/util/Replicator.java b/src/org/beanio/internal/util/Replicator.java index ea63760..8938114 100644 --- a/src/org/beanio/internal/util/Replicator.java +++ b/src/org/beanio/internal/util/Replicator.java @@ -30,7 +30,7 @@ */ public class Replicator { - private Set archetypes = new HashSet(); + private Set archetypes = new HashSet<>(); /** * Constructs a new Replicator. @@ -61,7 +61,7 @@ public T replicate(T value) { } // create a map of archetypes --> clones, aka old reference --> new reference - IdentityHashMap clones = new IdentityHashMap(); + IdentityHashMap clones = new IdentityHashMap<>(); // clone all registered archetypes and add their reference to the map for (Replicateable archetype : archetypes) { diff --git a/src/org/beanio/internal/util/ReplicatorTest.java b/src/org/beanio/internal/util/ReplicatorTest.java index d09b61a..2f15a05 100644 --- a/src/org/beanio/internal/util/ReplicatorTest.java +++ b/src/org/beanio/internal/util/ReplicatorTest.java @@ -65,7 +65,7 @@ public static void main(String[] args) { @SuppressWarnings("rawtypes") private static TreeNode createNode(String name) { - TreeNode node = new TreeNode(); + TreeNode node = new TreeNode<>(); node.setName(name); replicator.register(node); return node; diff --git a/src/org/beanio/internal/util/ToStringEnumTypeHandler.java b/src/org/beanio/internal/util/ToStringEnumTypeHandler.java index 4fd7ae7..5b953ee 100644 --- a/src/org/beanio/internal/util/ToStringEnumTypeHandler.java +++ b/src/org/beanio/internal/util/ToStringEnumTypeHandler.java @@ -24,7 +24,7 @@ public class ToStringEnumTypeHandler implements TypeHandler { public ToStringEnumTypeHandler(Class type) { this.type = type; - map = new HashMap(); + map = new HashMap<>(); Enum[] values = type.getEnumConstants(); for (Enum value : values) { diff --git a/src/org/beanio/internal/util/TreeNode.java b/src/org/beanio/internal/util/TreeNode.java index 98526a7..10759c2 100644 --- a/src/org/beanio/internal/util/TreeNode.java +++ b/src/org/beanio/internal/util/TreeNode.java @@ -54,10 +54,10 @@ public TreeNode(int size) { children = null; } else if (size < 0 || size > 10) { - children = new ArrayList(); + children = new ArrayList<>(); } else { - children = new ArrayList(size); + children = new ArrayList<>(size); } } @@ -158,7 +158,7 @@ public T getFirst() { */ public void add(T child) throws IllegalArgumentException { if (children == null) { - children = new ArrayList(); + children = new ArrayList<>(); } if (isSupportedChild(child)) { @@ -230,7 +230,7 @@ public void updateReferences(Map map) { return; } - List list = new ArrayList(children.size()); + List list = new ArrayList<>(children.size()); for (T node : children) { list.add((T) map.get(node)); } diff --git a/src/org/beanio/internal/util/TypeHandlerFactory.java b/src/org/beanio/internal/util/TypeHandlerFactory.java index 18ad9e2..9baa3fe 100644 --- a/src/org/beanio/internal/util/TypeHandlerFactory.java +++ b/src/org/beanio/internal/util/TypeHandlerFactory.java @@ -55,7 +55,7 @@ public class TypeHandlerFactory { private TypeHandlerFactory parent; private ClassLoader classLoader; - private Map handlerMap = new HashMap(); + private Map handlerMap = new HashMap<>(); private static final String NAME_KEY = "name:"; private static final String TYPE_KEY = "type:"; diff --git a/src/org/beanio/stream/csv/CsvReader.java b/src/org/beanio/stream/csv/CsvReader.java index bd269e9..a059358 100644 --- a/src/org/beanio/stream/csv/CsvReader.java +++ b/src/org/beanio/stream/csv/CsvReader.java @@ -62,7 +62,7 @@ public class CsvReader implements RecordReader { private transient int recordLineNumber; private transient int lineNumber = 0; private transient boolean skipLF = false; - private transient List fieldList = new ArrayList(); + private transient List fieldList = new ArrayList<>(); /** * Constructs a new CsvReader. diff --git a/src/org/beanio/stream/csv/CsvRecordParser.java b/src/org/beanio/stream/csv/CsvRecordParser.java index 02f9651..fc7f7f3 100644 --- a/src/org/beanio/stream/csv/CsvRecordParser.java +++ b/src/org/beanio/stream/csv/CsvRecordParser.java @@ -37,7 +37,7 @@ public class CsvRecordParser implements RecordMarshaller, RecordUnmarshaller { private boolean unquotedQuotesAllowed = false; private boolean alwaysQuote = false; - private List fieldList = new ArrayList(); + private List fieldList = new ArrayList<>(); /** * Constructs a new CsvRecordParser. diff --git a/src/org/beanio/stream/delimited/DelimitedReader.java b/src/org/beanio/stream/delimited/DelimitedReader.java index 47d9afd..2d7bb7a 100644 --- a/src/org/beanio/stream/delimited/DelimitedReader.java +++ b/src/org/beanio/stream/delimited/DelimitedReader.java @@ -68,7 +68,7 @@ public class DelimitedReader implements RecordReader { private transient int recordLineNumber; private transient int lineNumber = 0; private transient boolean skipLF = false; - private transient List fieldList = new ArrayList(); + private transient List fieldList = new ArrayList<>(); /** * Constructs a new DelimitedReader using a tab character for diff --git a/src/org/beanio/stream/delimited/DelimitedRecordParser.java b/src/org/beanio/stream/delimited/DelimitedRecordParser.java index a91ce56..62c59fa 100644 --- a/src/org/beanio/stream/delimited/DelimitedRecordParser.java +++ b/src/org/beanio/stream/delimited/DelimitedRecordParser.java @@ -32,7 +32,7 @@ public class DelimitedRecordParser implements RecordUnmarshaller, RecordMarshall private char escape; private boolean escapeEnabled; - private List fieldList = new ArrayList(); + private List fieldList = new ArrayList<>(); /** * Constructs a new DelimitedRecordParser. diff --git a/src/org/beanio/stream/json/JsonReaderSupport.java b/src/org/beanio/stream/json/JsonReaderSupport.java index 8ffa56b..4dea60f 100644 --- a/src/org/beanio/stream/json/JsonReaderSupport.java +++ b/src/org/beanio/stream/json/JsonReaderSupport.java @@ -57,7 +57,7 @@ protected Map readObject() throws IOException { String fieldName = null; StringBuilder text = null; - Map map = new HashMap(); + Map map = new HashMap<>(); int state = 0; @@ -178,7 +178,7 @@ else if (isWhitespace(c)) { * @throws IOException */ protected List readArray() throws IOException { - List list = new ArrayList(); + List list = new ArrayList<>(); StringBuilder text = null; int state = 0; diff --git a/src/org/beanio/stream/xml/ElementStack.java b/src/org/beanio/stream/xml/ElementStack.java index 79b0fb6..b455e3d 100644 --- a/src/org/beanio/stream/xml/ElementStack.java +++ b/src/org/beanio/stream/xml/ElementStack.java @@ -146,7 +146,7 @@ public String getName() { */ public void addNamespace(String prefix, String namespace) { if (nsMap == null) { - nsMap = new HashMap(); + nsMap = new HashMap<>(); } nsMap.put(namespace, prefix); } diff --git a/src/org/beanio/stream/xml/XmlParserConfiguration.java b/src/org/beanio/stream/xml/XmlParserConfiguration.java index 9aeab78..430e136 100644 --- a/src/org/beanio/stream/xml/XmlParserConfiguration.java +++ b/src/org/beanio/stream/xml/XmlParserConfiguration.java @@ -35,7 +35,7 @@ public class XmlParserConfiguration implements Cloneable { private String encoding = "utf-8"; /* Map of namespace prefixes to namespace uri's */ - private Map namespaceMap = new HashMap(); + private Map namespaceMap = new HashMap<>(); /** * Constructs a new XmlConfiguration. diff --git a/src/org/beanio/stream/xml/XmlRecordMarshaller.java b/src/org/beanio/stream/xml/XmlRecordMarshaller.java index ad6c1b7..78b7b4f 100644 --- a/src/org/beanio/stream/xml/XmlRecordMarshaller.java +++ b/src/org/beanio/stream/xml/XmlRecordMarshaller.java @@ -51,7 +51,7 @@ public class XmlRecordMarshaller implements RecordMarshaller { /* the next index to try when auto generating a namespace prefix */ private int namespaceCount = 0; /* Map of auto-generated namespace prefixes to namespaces */ - private Map namespaceMap = new HashMap(); + private Map namespaceMap = new HashMap<>(); /** * Constructs a new XmlRecordMarshaller. @@ -295,7 +295,7 @@ else if (attPrefix == null) { if (declareNamespace) { out.writeNamespace(attPrefix, attNamespace); if (attPrefixSet == null) { - attPrefixSet = new HashSet(); + attPrefixSet = new HashSet<>(); } attPrefixSet.add(attPrefix); } diff --git a/src/org/beanio/stream/xml/XmlWriter.java b/src/org/beanio/stream/xml/XmlWriter.java index 8a49a13..519217d 100644 --- a/src/org/beanio/stream/xml/XmlWriter.java +++ b/src/org/beanio/stream/xml/XmlWriter.java @@ -95,7 +95,7 @@ public class XmlWriter implements RecordWriter, StatefulWriter { /* the next index to try when auto generating a namespace prefix */ private int namespaceCount = 0; /* Map of auto-generated namespace prefixes to namespaces */ - private Map namespaceMap = new HashMap(); + private Map namespaceMap = new HashMap<>(); /* the minimum level last stored when the state was updated */ private int dirtyLevel = 0; @@ -365,7 +365,7 @@ else if (attPrefix == null) { if (declareNamespace) { out.writeNamespace(attPrefix, attNamespace); if (attPrefixSet == null) { - attPrefixSet = new HashSet(); + attPrefixSet = new HashSet<>(); } attPrefixSet.add(attPrefix); } @@ -664,7 +664,7 @@ private Map toMap(String token, String key) { if (s.length % 2 != 0) { throw new IllegalStateException("Invalid state information for key '" + key + "'"); } - Map map = new HashMap(); + Map map = new HashMap<>(); for (int n=0; n map = new HashMap(); + Map map = new HashMap<>(); map.put("widget", w); StringWriter text = new StringWriter(); diff --git a/test/org/beanio/parser/bean/Widget.java b/test/org/beanio/parser/bean/Widget.java index b0e40e2..3379f72 100644 --- a/test/org/beanio/parser/bean/Widget.java +++ b/test/org/beanio/parser/bean/Widget.java @@ -75,7 +75,7 @@ public Widget getPart(int index) { } public void addPart(Widget w) { if (partsList == null) { - partsList = new ArrayList(); + partsList = new ArrayList<>(); } partsList.add(w); } diff --git a/test/org/beanio/parser/collection/CollectionFieldParserTest.java b/test/org/beanio/parser/collection/CollectionFieldParserTest.java index 3bc41a0..c7e884d 100644 --- a/test/org/beanio/parser/collection/CollectionFieldParserTest.java +++ b/test/org/beanio/parser/collection/CollectionFieldParserTest.java @@ -94,7 +94,7 @@ public void testCollectionFixedLength() { try { CollectionBean bean = (CollectionBean) in.read(); assertArrayEquals(new int[] { 1, 100, 24 }, bean.getArray()); - assertEquals(new HashSet(Arrays.asList('A', 'B', 'C', ' ')), bean.getSet()); + assertEquals(new HashSet<>(Arrays.asList('A', 'B', 'C', ' ')), bean.getSet()); StringWriter text = new StringWriter(); factory.createWriter("fc1", text).write(bean); From a750a1ca413e827a9b839e6a36776f2c74ee206b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Garcia?= Date: Sun, 17 Jan 2016 05:10:06 -0200 Subject: [PATCH 3/4] Using override --- .../beanio/BeanReaderErrorHandlerSupport.java | 1 + src/org/beanio/Marshaller.java | 1 + .../beanio/builder/SegmentBuilderSupport.java | 1 + .../compiler/ParserFactorySupport.java | 4 +++ .../internal/compiler/Preprocessor.java | 11 +++++++ .../accessor/ReflectionAccessorFactory.java | 2 ++ .../compiler/flat/FlatParserFactory.java | 1 + .../beanio/internal/config/GroupConfig.java | 3 ++ .../beanio/internal/config/RecordConfig.java | 2 ++ .../beanio/internal/config/SegmentConfig.java | 2 ++ .../config/annotation/AnnotationParser.java | 1 + .../config/xml/XmlConfigurationLoader.java | 1 + .../internal/config/xml/XmlMappingParser.java | 1 + .../internal/config/xml/XmlMappingReader.java | 4 +++ .../beanio/internal/parser/Aggregation.java | 8 +++++ src/org/beanio/internal/parser/Bean.java | 8 +++++ .../internal/parser/BeanReaderImpl.java | 10 ++++++ .../internal/parser/BeanWriterImpl.java | 8 +++++ .../internal/parser/CollectionBean.java | 6 ++++ .../internal/parser/CollectionParser.java | 11 +++++++ src/org/beanio/internal/parser/Constant.java | 12 +++++++ .../internal/parser/DelegatingParser.java | 10 ++++++ .../beanio/internal/parser/ErrorContext.java | 13 ++++++++ src/org/beanio/internal/parser/Field.java | 19 +++++++++++ src/org/beanio/internal/parser/Group.java | 31 +++++++++++++++++ src/org/beanio/internal/parser/MapParser.java | 10 ++++++ .../internal/parser/MarshallerImpl.java | 11 +++++++ .../internal/parser/MarshallingContext.java | 1 + .../internal/parser/PropertyComponent.java | 6 ++++ src/org/beanio/internal/parser/Record.java | 18 ++++++++++ .../internal/parser/RecordAggregation.java | 23 +++++++++++++ .../internal/parser/RecordCollection.java | 1 + src/org/beanio/internal/parser/RecordMap.java | 1 + src/org/beanio/internal/parser/Segment.java | 11 +++++++ .../internal/parser/StreamFormatSupport.java | 5 +++ .../internal/parser/UnmarshallerImpl.java | 12 +++++++ .../accessor/FieldReflectionAccessor.java | 2 ++ .../internal/parser/accessor/MapAccessor.java | 4 +++ .../accessor/MethodReflectionAccessor.java | 2 ++ .../accessor/PropertyAccessorSupport.java | 2 ++ .../DelimitedMarshallingContext.java | 1 + .../delimited/DelimitedRecordFormat.java | 2 ++ .../delimited/DelimitedStreamFormat.java | 2 ++ .../FixedLengthMarshallingContext.java | 1 + .../fixedlength/FixedLengthRecordFormat.java | 2 ++ .../fixedlength/FixedLengthStreamFormat.java | 2 ++ .../format/flat/FlatFieldFormatSupport.java | 7 ++++ .../parser/format/json/JsonFieldFormat.java | 11 +++++++ .../parser/format/json/JsonStreamFormat.java | 2 ++ .../parser/format/json/JsonWrapper.java | 6 ++++ .../parser/format/xml/XmlAttributeField.java | 9 +++++ .../parser/format/xml/XmlElementField.java | 9 +++++ .../parser/format/xml/XmlFieldFormat.java | 5 +++ .../parser/format/xml/XmlSelectorWrapper.java | 33 +++++++++++++++++++ .../parser/format/xml/XmlStreamFormat.java | 3 ++ .../parser/format/xml/XmlTextField.java | 7 ++++ .../parser/format/xml/XmlWrapper.java | 8 +++++ .../message/ResourceBundleMessageFactory.java | 4 +++ src/org/beanio/internal/util/BeanUtil.java | 9 +++++ .../beanio/internal/util/EnumTypeHandler.java | 3 ++ src/org/beanio/internal/util/StringUtil.java | 1 + .../util/ToStringEnumTypeHandler.java | 3 ++ src/org/beanio/internal/util/TreeNode.java | 3 ++ .../internal/util/TypeHandlerFactory.java | 4 +++ .../stream/RecordParserFactorySupport.java | 5 +++ src/org/beanio/stream/csv/CsvReader.java | 4 +++ .../beanio/stream/csv/CsvRecordParser.java | 2 ++ .../stream/csv/CsvRecordParserFactory.java | 5 +++ src/org/beanio/stream/csv/CsvWriter.java | 3 ++ .../stream/delimited/DelimitedReader.java | 4 +++ .../delimited/DelimitedRecordParser.java | 2 ++ .../DelimitedRecordParserFactory.java | 5 +++ .../stream/delimited/DelimitedWriter.java | 3 ++ .../stream/fixedlength/FixedLengthReader.java | 4 +++ .../fixedlength/FixedLengthRecordParser.java | 2 ++ .../FixedLengthRecordParserFactory.java | 5 +++ .../stream/fixedlength/FixedLengthWriter.java | 3 ++ src/org/beanio/stream/json/JsonReader.java | 4 +++ .../stream/json/JsonRecordMarshaller.java | 1 + .../stream/json/JsonRecordParserFactory.java | 5 +++ .../stream/json/JsonRecordUnmarshaller.java | 1 + src/org/beanio/stream/json/JsonWriter.java | 3 ++ src/org/beanio/stream/xml/XmlReader.java | 4 +++ .../stream/xml/XmlRecordMarshaller.java | 1 + .../stream/xml/XmlRecordParserFactory.java | 6 ++++ .../stream/xml/XmlRecordUnmarshaller.java | 1 + src/org/beanio/stream/xml/XmlWriter.java | 5 +++ .../beanio/types/BigDecimalTypeHandler.java | 1 + .../beanio/types/BigIntegerTypeHandler.java | 1 + src/org/beanio/types/BooleanTypeHandler.java | 3 ++ src/org/beanio/types/ByteTypeHandler.java | 1 + src/org/beanio/types/CalendarTypeHandler.java | 3 ++ .../beanio/types/CharacterTypeHandler.java | 3 ++ src/org/beanio/types/DateTypeHandler.java | 3 ++ .../beanio/types/DateTypeHandlerSupport.java | 1 + src/org/beanio/types/DoubleTypeHandler.java | 1 + src/org/beanio/types/FloatTypeHandler.java | 1 + src/org/beanio/types/IntegerTypeHandler.java | 1 + src/org/beanio/types/LongTypeHandler.java | 1 + src/org/beanio/types/NumberTypeHandler.java | 3 ++ src/org/beanio/types/ShortTypeHandler.java | 1 + src/org/beanio/types/StringTypeHandler.java | 3 ++ src/org/beanio/types/URLTypeHandler.java | 3 ++ src/org/beanio/types/UUIDTypeHandler.java | 3 ++ .../types/xml/XmlBooleanTypeHandler.java | 3 ++ test/org/beanio/beans/Order.java | 1 + test/org/beanio/beans/OrderBatch.java | 1 + test/org/beanio/beans/Person.java | 1 + .../parser/annotation/AnnotatedUser.java | 1 + test/org/beanio/parser/bean/Widget.java | 1 + test/org/beanio/parser/types/TypeEnum.java | 1 + .../parser/writemode/WriteModeParserTest.java | 4 +++ test/org/beanio/parser/xml/Address.java | 1 + test/org/beanio/parser/xml/Person.java | 1 + test/org/beanio/util/IOUtilTest.java | 4 +++ 115 files changed, 547 insertions(+) diff --git a/src/org/beanio/BeanReaderErrorHandlerSupport.java b/src/org/beanio/BeanReaderErrorHandlerSupport.java index 69e557a..a755e19 100644 --- a/src/org/beanio/BeanReaderErrorHandlerSupport.java +++ b/src/org/beanio/BeanReaderErrorHandlerSupport.java @@ -37,6 +37,7 @@ public BeanReaderErrorHandlerSupport() { } * @throws Exception if the BeanReaderException is rethrown or this error * handler throws a new Exception */ + @Override public final void handleError(BeanReaderException ex) throws Exception { if (ex instanceof InvalidRecordException) { invalidRecord((InvalidRecordException)ex); diff --git a/src/org/beanio/Marshaller.java b/src/org/beanio/Marshaller.java index f059d64..9afef6d 100644 --- a/src/org/beanio/Marshaller.java +++ b/src/org/beanio/Marshaller.java @@ -75,6 +75,7 @@ public interface Marshaller extends Debuggable { * @return the record text * @throws BeanWriterException if a fatal error occurs */ + @Override public String toString() throws BeanWriterException; /** diff --git a/src/org/beanio/builder/SegmentBuilderSupport.java b/src/org/beanio/builder/SegmentBuilderSupport.java index 93d9997..d85776c 100644 --- a/src/org/beanio/builder/SegmentBuilderSupport.java +++ b/src/org/beanio/builder/SegmentBuilderSupport.java @@ -27,6 +27,7 @@ public abstract class SegmentBuilderSupport> SegmentBuilderSupport() { } + @Override protected abstract SegmentConfig getConfig(); /** diff --git a/src/org/beanio/internal/compiler/ParserFactorySupport.java b/src/org/beanio/internal/compiler/ParserFactorySupport.java index ff7638f..a37dc33 100644 --- a/src/org/beanio/internal/compiler/ParserFactorySupport.java +++ b/src/org/beanio/internal/compiler/ParserFactorySupport.java @@ -76,6 +76,7 @@ public ParserFactorySupport() { } * @return the new {@link Stream} * @throws BeanIOConfigurationException if the configuration is invalid */ + @Override public Stream createStream(StreamConfig config) throws BeanIOConfigurationException { if (config.getName() == null) { throw new BeanIOConfigurationException("stream name not configured"); @@ -245,6 +246,7 @@ protected void updateConstructor(Bean bean) { // sort arguments by constructor index Collections.sort(args, new Comparator() { + @Override public int compare(Property o1, Property o2) { return o1.getAccessor().getConstructorArgumentIndex() - o2.getAccessor().getConstructorArgumentIndex(); @@ -1652,6 +1654,7 @@ protected Object parseDefaultValue(Field field, String text) { * @param typeHandlerFactory the TypeHandlerFactory to use to * create the stream definition */ + @Override public void setTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory) { this.typeHandlerFactory = typeHandlerFactory; } @@ -1721,6 +1724,7 @@ else if (parserFactoryBean.getInstance() != null) { * (non-Javadoc) * @see org.beanio.factory.ParserFactory#setClassLoader(java.lang.ClassLoader) */ + @Override public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } diff --git a/src/org/beanio/internal/compiler/Preprocessor.java b/src/org/beanio/internal/compiler/Preprocessor.java index 7968611..d1a6671 100644 --- a/src/org/beanio/internal/compiler/Preprocessor.java +++ b/src/org/beanio/internal/compiler/Preprocessor.java @@ -50,6 +50,7 @@ public Preprocessor(StreamConfig stream) { * Initializes a stream configuration before its children have been processed. * @param stream the stream configuration to process */ + @Override protected void initializeStream(StreamConfig stream) throws BeanIOConfigurationException { if (stream.getMinOccurs() == null) { stream.setMinOccurs(0); @@ -68,6 +69,7 @@ protected void initializeStream(StreamConfig stream) throws BeanIOConfigurationE * Finalizes a stream configuration after its children have been processed. * @param stream the stream configuration to finalize */ + @Override protected void finalizeStream(StreamConfig stream) throws BeanIOConfigurationException { finalizeGroup(stream); @@ -78,6 +80,7 @@ protected void finalizeStream(StreamConfig stream) throws BeanIOConfigurationExc if (sorted) { stream.sort(new Comparator() { + @Override public int compare(ComponentConfig c1, ComponentConfig c2) { Integer p1 = getPosition(c1); Integer p2 = getPosition(c2); @@ -125,6 +128,7 @@ private Integer getPosition(ComponentConfig c) { * Initializes a group configuration before its children have been processed. * @param group the group configuration to process */ + @Override protected void initializeGroup(GroupConfig group) throws BeanIOConfigurationException { if (group.getMinOccurs() == null) { @@ -171,6 +175,7 @@ protected void initializeGroup(GroupConfig group) throws BeanIOConfigurationExce * Finalizes a group configuration after its children have been processed. * @param group the group configuration to finalize */ + @Override protected void finalizeGroup(GroupConfig group) throws BeanIOConfigurationException { // order must be set for all group children, or for none of them @@ -225,6 +230,7 @@ else if (orderSet ^ (child.getOrder() != null)) { * Initializes a record configuration before its children have been processed. * @param record the record configuration to process */ + @Override protected void initializeRecord(RecordConfig record) throws BeanIOConfigurationException { // a record is ignored if a 'class' was not set and the property root is null @@ -262,6 +268,7 @@ protected void initializeRecord(RecordConfig record) throws BeanIOConfigurationE * Finalizes a record configuration after its children have been processed. * @param record the record configuration to process */ + @Override protected void finalizeRecord(RecordConfig record) throws BeanIOConfigurationException { finalizeSegment(record); @@ -274,6 +281,7 @@ protected void finalizeRecord(RecordConfig record) throws BeanIOConfigurationExc * Initializes a segment configuration before its children have been processed. * @param segment the segment configuration to process */ + @Override protected void initializeSegment(SegmentConfig segment) throws BeanIOConfigurationException { if (segment.getName() == null) { @@ -339,6 +347,7 @@ protected void initializeSegment(SegmentConfig segment) throws BeanIOConfigurati * Finalizes a segment configuration after its children have been processed. * @param segment the segment configuration to process */ + @Override protected void finalizeSegment(SegmentConfig segment) throws BeanIOConfigurationException { for (PropertyConfig child : segment.getPropertyList()) { if (child.isIdentifier()) { @@ -352,6 +361,7 @@ protected void finalizeSegment(SegmentConfig segment) throws BeanIOConfiguration * Processes a field configuration. * @param field the field configuration to process */ + @Override protected void handleField(FieldConfig field) throws BeanIOConfigurationException { // ignore fields that belong to ignored records if (recordIgnored) { @@ -418,6 +428,7 @@ protected void handleField(FieldConfig field) throws BeanIOConfigurationExceptio * Processes a constant configuration. * @param constant the constant configuration to process */ + @Override protected void handleConstant(ConstantConfig constant) throws BeanIOConfigurationException { constant.setBound(true); diff --git a/src/org/beanio/internal/compiler/accessor/ReflectionAccessorFactory.java b/src/org/beanio/internal/compiler/accessor/ReflectionAccessorFactory.java index dba4812..146d555 100644 --- a/src/org/beanio/internal/compiler/accessor/ReflectionAccessorFactory.java +++ b/src/org/beanio/internal/compiler/accessor/ReflectionAccessorFactory.java @@ -19,6 +19,7 @@ public class ReflectionAccessorFactory implements PropertyAccessorFactory { * (non-Javadoc) * @see org.beanio.internal.compiler.PropertyAccessorFactory#getPropertyAccessor(java.lang.Class, java.beans.PropertyDescriptor, int) */ + @Override public PropertyAccessor getPropertyAccessor( Class parent, PropertyDescriptor descriptor, int carg) { @@ -31,6 +32,7 @@ public PropertyAccessor getPropertyAccessor( * (non-Javadoc) * @see org.beanio.internal.compiler.PropertyAccessorFactory#getPropertyAccessor(java.lang.Class, java.lang.reflect.Field, int) */ + @Override public PropertyAccessor getPropertyAccessor( Class parent, Field field, int carg) { diff --git a/src/org/beanio/internal/compiler/flat/FlatParserFactory.java b/src/org/beanio/internal/compiler/flat/FlatParserFactory.java index 3ded981..12fba8a 100644 --- a/src/org/beanio/internal/compiler/flat/FlatParserFactory.java +++ b/src/org/beanio/internal/compiler/flat/FlatParserFactory.java @@ -53,6 +53,7 @@ private static class NodeComparator implements Comparator { * (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(Component o1, Component o2) { return getPosition(o1).compareTo(getPosition(o2)); } diff --git a/src/org/beanio/internal/config/GroupConfig.java b/src/org/beanio/internal/config/GroupConfig.java index 62b17ca..09b9fa2 100644 --- a/src/org/beanio/internal/config/GroupConfig.java +++ b/src/org/beanio/internal/config/GroupConfig.java @@ -48,6 +48,7 @@ public char getComponentType() { * number may appear in any order. * @return the order of this record */ + @Override public Integer getOrder() { return order; } @@ -58,6 +59,7 @@ public Integer getOrder() { * number may appear in any order. * @param order the order of this record */ + @Override public void setOrder(Integer order) { this.order = order; } @@ -67,6 +69,7 @@ public void setOrder(Integer order) { * Map key when collection is set to map. * @return the key property name */ + @Override public String getKey() { return key; } diff --git a/src/org/beanio/internal/config/RecordConfig.java b/src/org/beanio/internal/config/RecordConfig.java index 4014eff..610ee3e 100644 --- a/src/org/beanio/internal/config/RecordConfig.java +++ b/src/org/beanio/internal/config/RecordConfig.java @@ -119,6 +119,7 @@ public void setMaxMatchLength(Integer maxMatchLength) { * number may appear in any order. * @return the order of this record */ + @Override public Integer getOrder() { return order; } @@ -129,6 +130,7 @@ public Integer getOrder() { * number may appear in any order. * @param order the order of this record */ + @Override public void setOrder(Integer order) { this.order = order; } diff --git a/src/org/beanio/internal/config/SegmentConfig.java b/src/org/beanio/internal/config/SegmentConfig.java index 7b869c3..d267aac 100644 --- a/src/org/beanio/internal/config/SegmentConfig.java +++ b/src/org/beanio/internal/config/SegmentConfig.java @@ -52,6 +52,7 @@ public SegmentConfig() { } * (non-Javadoc) * @see org.beanio.config.PropertyConfig#type() */ + @Override public char getComponentType() { return SEGMENT; } @@ -134,6 +135,7 @@ public void setDefaultExistence(boolean defaultExistence) { * Map key when collection is set to map. * @return the key property name */ + @Override public String getKey() { return key; } diff --git a/src/org/beanio/internal/config/annotation/AnnotationParser.java b/src/org/beanio/internal/config/annotation/AnnotationParser.java index 795d3a1..5310d2d 100644 --- a/src/org/beanio/internal/config/annotation/AnnotationParser.java +++ b/src/org/beanio/internal/config/annotation/AnnotationParser.java @@ -35,6 +35,7 @@ public class AnnotationParser { private static final Comparator ORDINAL_COMPARATOR = new Comparator() { + @Override public int compare(ComponentConfig c1, ComponentConfig c2) { Integer o1 = c1.getOrdinal(); Integer o2 = c2.getOrdinal(); diff --git a/src/org/beanio/internal/config/xml/XmlConfigurationLoader.java b/src/org/beanio/internal/config/xml/XmlConfigurationLoader.java index dd61c15..4f5c7ea 100644 --- a/src/org/beanio/internal/config/xml/XmlConfigurationLoader.java +++ b/src/org/beanio/internal/config/xml/XmlConfigurationLoader.java @@ -46,6 +46,7 @@ public XmlConfigurationLoader(ClassLoader classLoader) { * (non-Javadoc) * @see org.beanio.config.MultiConfigurationLoader#loadConfigurations(java.io.InputStream) */ + @Override public Collection loadConfiguration(InputStream in, Properties properties) throws IOException, BeanIOConfigurationException { return createParser().loadConfiguration(in, properties); diff --git a/src/org/beanio/internal/config/xml/XmlMappingParser.java b/src/org/beanio/internal/config/xml/XmlMappingParser.java index 6a71f50..f46ccf4 100644 --- a/src/org/beanio/internal/config/xml/XmlMappingParser.java +++ b/src/org/beanio/internal/config/xml/XmlMappingParser.java @@ -754,6 +754,7 @@ protected ConstantConfig createConstantConfig(Element element) { * (non-Javadoc) * @see org.beanio.internal.util.StringUtil.PropertiesSource#getProperty(java.lang.String) */ + @Override public String getProperty(String key) { String value = null; if (properties != null) { diff --git a/src/org/beanio/internal/config/xml/XmlMappingReader.java b/src/org/beanio/internal/config/xml/XmlMappingReader.java index a5531a1..6f26da0 100644 --- a/src/org/beanio/internal/config/xml/XmlMappingReader.java +++ b/src/org/beanio/internal/config/xml/XmlMappingReader.java @@ -68,16 +68,19 @@ public Document loadDocument(InputStream in) throws IOException, final List errorMessages = new ArrayList<>(); builder.setErrorHandler(new ErrorHandler() { + @Override public void warning(SAXParseException exception) throws SAXException { errorMessages.add("Error at line " + exception.getLineNumber() + ": " + exception.getMessage()); } + @Override public void error(SAXParseException exception) throws SAXException { errorMessages.add("Error at line " + exception.getLineNumber() + ": " + exception.getMessage()); } + @Override public void fatalError(SAXParseException exception) throws SAXException { throw exception; } @@ -138,6 +141,7 @@ protected EntityResolver createEntityResolver() { } private static class DefaultEntityResolver implements EntityResolver { + @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (publicId == null && (BEANIO_XMLNS.equals(systemId) || diff --git a/src/org/beanio/internal/parser/Aggregation.java b/src/org/beanio/internal/parser/Aggregation.java index 21b7ae7..bc53089 100644 --- a/src/org/beanio/internal/parser/Aggregation.java +++ b/src/org/beanio/internal/parser/Aggregation.java @@ -65,6 +65,7 @@ public Aggregation() { } * (non-Javadoc) * @see org.beanio.parser2.Marshaller#marshal(org.beanio.parser2.MarshallingContext) */ + @Override public final boolean marshal(MarshallingContext context) throws IOException { int min = minOccurs; @@ -85,6 +86,7 @@ public final boolean marshal(MarshallingContext context) throws IOException { * (non-Javadoc) * @see org.beanio.parser2.Field#unmarshal(org.beanio.parser2.UnmarshallingContext) */ + @Override public final boolean unmarshal(UnmarshallingContext context) { int min = minOccurs; @@ -123,6 +125,7 @@ else if (occursVal > maxOccurs) { * (non-Javadoc) * @see org.beanio.parser2.DelegatingParser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { if (occurs != null && !occurs.isBound()) { occurs.setValue(context, length(value)); @@ -145,6 +148,7 @@ public boolean isIdentifier() { /** * @throws UnsupportedOperationException */ + @Override public void setIdentifier(boolean identifier) { if (identifier) { throw new UnsupportedOperationException(); @@ -155,6 +159,7 @@ public void setIdentifier(boolean identifier) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#getAccessor() */ + @Override public PropertyAccessor getAccessor() { return accessor; } @@ -163,6 +168,7 @@ public PropertyAccessor getAccessor() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#setAccessor(org.beanio.internal.parser.PropertyAccessor) */ + @Override public void setAccessor(PropertyAccessor accessor) { this.accessor = accessor; } @@ -171,6 +177,7 @@ public void setAccessor(PropertyAccessor accessor) { * (non-Javadoc) * @see org.beanio.parser2.Iteration#getIterationIndex() */ + @Override public final int getIterationIndex(ParsingContext context) { return index.get(context); } @@ -211,6 +218,7 @@ public void setLazy(boolean lazy) { this.lazy = lazy; } + @Override public boolean isDynamicIteration() { return occurs != null; } diff --git a/src/org/beanio/internal/parser/Bean.java b/src/org/beanio/internal/parser/Bean.java index edc79e5..eacb549 100644 --- a/src/org/beanio/internal/parser/Bean.java +++ b/src/org/beanio/internal/parser/Bean.java @@ -34,6 +34,7 @@ public class Bean extends PropertyComponent implements Property { // the bean object private ParserLocal bean = new ParserLocal() { + @Override public Object createDefaultValue() { return isRequired() ? null : Value.MISSING; } @@ -42,6 +43,7 @@ public Object createDefaultValue() { private Constructor constructor; // used to temporarily hold constructor argument values when a constructor is specified private ParserLocal constructorArgs = new ParserLocal() { + @Override public Object[] createDefaultValue() { return constructor != null ? new Object[constructor.getParameterTypes().length] : null; } @@ -58,6 +60,7 @@ public Bean() { } * (non-Javadoc) * @see org.beanio.parser.Property#clearValue() */ + @Override public void clearValue(ParsingContext context) { for (Component child : getChildren()) { ((Property) child).clearValue(context); @@ -69,6 +72,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Property#defines(java.lang.Object) */ + @Override public boolean defines(Object bean) { if (getType() == null) { return false; @@ -110,6 +114,7 @@ public boolean defines(Object bean) { * (non-Javadoc) * @see org.beanio.parser.Property#createValue() */ + @Override public Object createValue(ParsingContext context) { Object b = null; @@ -250,6 +255,7 @@ private void backfill(ParsingContext context, Object bean, Component stop) { * (non-Javadoc) * @see org.beanio.parser2.Property#getValue() */ + @Override public Object getValue(ParsingContext context) { return bean.get(context); } @@ -258,6 +264,7 @@ public Object getValue(ParsingContext context) { * Sets the bean object and populates all of its child properties. * */ + @Override public void setValue(ParsingContext context, Object value) { if (value == null) { clearValue(context); @@ -320,6 +327,7 @@ public void setRequired(boolean required) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#type() */ + @Override public int type() { return (isMap()) ? Property.MAP : Property.COMPLEX; } diff --git a/src/org/beanio/internal/parser/BeanReaderImpl.java b/src/org/beanio/internal/parser/BeanReaderImpl.java index bc47236..0e9d6ee 100644 --- a/src/org/beanio/internal/parser/BeanReaderImpl.java +++ b/src/org/beanio/internal/parser/BeanReaderImpl.java @@ -54,6 +54,7 @@ public BeanReaderImpl(UnmarshallingContext context, Selector layout) { * (non-Javadoc) * @see org.beanio.BeanReader#read() */ + @Override public Object read() { ensureOpen(); @@ -194,6 +195,7 @@ private Selector nextRecord() throws BeanReaderException { * (non-Javadoc) * @see org.beanio.BeanReader#skip(int) */ + @Override public int skip(int count) throws BeanReaderIOException, MalformedRecordException, UnidentifiedRecordException, UnexpectedRecordException { @@ -229,6 +231,7 @@ public int skip(int count) throws BeanReaderIOException, MalformedRecordExceptio * (non-Javadoc) * @see org.beanio.impl.AbstractBeanReader#close() */ + @Override public void close() throws BeanReaderIOException { ensureOpen(); @@ -247,6 +250,7 @@ public void close() throws BeanReaderIOException { * (non-Javadoc) * @see org.beanio.BeanReader#getName() */ + @Override public String getRecordName() { return recordName; } @@ -255,6 +259,7 @@ public String getRecordName() { * (non-Javadoc) * @see org.beanio.BeanReader#getLineNumber() */ + @Override public int getLineNumber() { return lineNumber; } @@ -263,6 +268,7 @@ public int getLineNumber() { * (non-Javadoc) * @see org.beanio.BeanReader#getRecordCount() */ + @Override public int getRecordCount() { return context == null ? 0: context.getRecordCount(); } @@ -271,6 +277,7 @@ public int getRecordCount() { * (non-Javadoc) * @see org.beanio.BeanReader#getRecordContext(int) */ + @Override public RecordContext getRecordContext(int index) { if (context == null) { throw new IndexOutOfBoundsException(); @@ -282,6 +289,7 @@ public RecordContext getRecordContext(int index) { * (non-Javadoc) * @see org.beanio.BeanReader#setErrorHandler(org.beanio.BeanReaderErrorHandler) */ + @Override public void setErrorHandler(BeanReaderErrorHandler errorHandler) { this.errorHandler = errorHandler; } @@ -320,9 +328,11 @@ public void setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords) { this.ignoreUnidentifiedRecords = ignoreUnidentifiedRecords; } + @Override public void debug() { debug(System.out); } + @Override public void debug(PrintStream out) { ((Component)layout).print(out); } diff --git a/src/org/beanio/internal/parser/BeanWriterImpl.java b/src/org/beanio/internal/parser/BeanWriterImpl.java index 5a38aec..c9903a5 100644 --- a/src/org/beanio/internal/parser/BeanWriterImpl.java +++ b/src/org/beanio/internal/parser/BeanWriterImpl.java @@ -47,6 +47,7 @@ public BeanWriterImpl(MarshallingContext context, Selector layout) { * (non-Javadoc) * @see org.beanio.BeanWriter#write(java.lang.Object) */ + @Override public void write(Object bean) throws BeanWriterException { write(null, bean); } @@ -55,6 +56,7 @@ public void write(Object bean) throws BeanWriterException { * (non-Javadoc) * @see org.beanio.BeanWriter#write(java.lang.String, java.lang.Object) */ + @Override public void write(String recordName, Object bean) throws BeanWriterException { ensureOpen(); @@ -103,6 +105,7 @@ public void write(String recordName, Object bean) throws BeanWriterException { * (non-Javadoc) * @see org.beanio.BeanWriter#flush() */ + @Override public void flush() throws BeanWriterIOException { ensureOpen(); @@ -118,6 +121,7 @@ public void flush() throws BeanWriterIOException { * (non-Javadoc) * @see org.beanio.BeanWriter#close() */ + @Override public void close() throws BeanWriterIOException { ensureOpen(); @@ -146,6 +150,7 @@ private void ensureOpen() { * (non-Javadoc) * @see org.beanio.parser.StatefulBeanWriter#updateState(java.lang.String, java.util.Map) */ + @Override public void updateState(String namespace, Map state) { layout.updateState(context, namespace + ".m", state); @@ -159,6 +164,7 @@ public void updateState(String namespace, Map state) { * (non-Javadoc) * @see org.beanio.parser.StatefulBeanWriter#restoreState(java.lang.String, java.util.Map) */ + @Override public void restoreState(String namespace, Map state) throws IllegalStateException { layout.restoreState(context, namespace + ".m", state); @@ -168,9 +174,11 @@ public void restoreState(String namespace, Map state) throws Ill } } + @Override public void debug() { debug(System.out); } + @Override public void debug(PrintStream out) { ((Component)layout).print(out); } diff --git a/src/org/beanio/internal/parser/CollectionBean.java b/src/org/beanio/internal/parser/CollectionBean.java index cc8975d..af0ba9e 100644 --- a/src/org/beanio/internal/parser/CollectionBean.java +++ b/src/org/beanio/internal/parser/CollectionBean.java @@ -43,6 +43,7 @@ public CollectionBean() { } * (non-Javadoc) * @see org.beanio.internal.parser.Property#type() */ + @Override public int type() { return Property.COLLECTION; } @@ -51,6 +52,7 @@ public int type() { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyComponent#clearValue() */ + @Override public void clearValue(ParsingContext context) { for (Component child : getChildren()) { ((Property) child).clearValue(context); @@ -63,6 +65,7 @@ public void clearValue(ParsingContext context) { * @see org.beanio.internal.parser.PropertyComponent#createValue() */ @SuppressWarnings("unchecked") + @Override public Object createValue(ParsingContext context) { Object b = null; @@ -115,6 +118,7 @@ private void backfill(Collection collection, Component to) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyComponent#getValue() */ + @Override public Object getValue(ParsingContext context) { return bean.get(context); } @@ -123,6 +127,7 @@ public Object getValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyComponent#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { if (value == null) { clearValue(null); @@ -146,6 +151,7 @@ public void setValue(ParsingContext context, Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyComponent#defines(java.lang.Object) */ + @Override public boolean defines(Object value) { if (getType() == null) { return false; diff --git a/src/org/beanio/internal/parser/CollectionParser.java b/src/org/beanio/internal/parser/CollectionParser.java index 4865df6..c3fcfdf 100644 --- a/src/org/beanio/internal/parser/CollectionParser.java +++ b/src/org/beanio/internal/parser/CollectionParser.java @@ -45,6 +45,7 @@ public CollectionParser() { } * (non-Javadoc) * @see org.beanio.parser2.DelegatingParser#clear() */ + @Override public void clearValue(ParsingContext context) { this.value.set(context, null); } @@ -53,6 +54,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Property#defines(java.lang.Object) */ + @Override public boolean defines(Object value) { // TODO implement for arrays.... @@ -73,6 +75,7 @@ public boolean defines(Object value) { * (non-Javadoc) * @see org.beanio.parser.DelegatingParser#matches(org.beanio.parser.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { // matching repeating fields is not supported return true; @@ -185,6 +188,7 @@ else if (invalid) { * Returns whether this iteration is a property of a bean object. * @return true if this iteration is a property, false otherwise */ + @Override public boolean isProperty() { return type != null; } @@ -222,6 +226,7 @@ protected int length(Object value) { * */ @SuppressWarnings("unchecked") + @Override public void setType(Class collectionType) { this.type = (Class>) collectionType; } @@ -229,6 +234,7 @@ public void setType(Class collectionType) { /* * Returns the property type. */ + @Override public Class> getType() { return type; } @@ -237,6 +243,7 @@ public Class> getType() { * (non-Javadoc) * @see org.beanio.parser2.Property#create() */ + @Override public Object createValue(ParsingContext context) { Object value = this.value.get(context); if (value == null) { @@ -250,6 +257,7 @@ public Object createValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.DelegatingParser#getValue() */ + @Override public Object getValue(ParsingContext context) { Object value = this.value.get(context); return value == null ? Value.MISSING : value; @@ -259,6 +267,7 @@ public Object getValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.DelegatingParser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { // convert empty collections to null so that parent parsers // will consider this property missing during marshalling @@ -279,6 +288,7 @@ protected Collection createCollection() { * (non-Javadoc) * @see org.beanio.parser2.Property#type() */ + @Override public int type() { return Property.AGGREGATION_COLLECTION; } @@ -287,6 +297,7 @@ public int type() { * (non-Javadoc) * @see org.beanio.parser2.Iteration#getIterationSize() */ + @Override public int getIterationSize() { return getSize(); } diff --git a/src/org/beanio/internal/parser/Constant.java b/src/org/beanio/internal/parser/Constant.java index cf21779..3dd8837 100644 --- a/src/org/beanio/internal/parser/Constant.java +++ b/src/org/beanio/internal/parser/Constant.java @@ -36,6 +36,7 @@ public Constant() { } * (non-Javadoc) * @see org.beanio.parser.Property#type() */ + @Override public int type() { return Property.SIMPLE; } @@ -44,6 +45,7 @@ public int type() { * (non-Javadoc) * @see org.beanio.parser.Property#defines(java.lang.Object) */ + @Override public boolean defines(Object value) { return this.value.equals(value); } @@ -52,12 +54,14 @@ public boolean defines(Object value) { * (non-Javadoc) * @see org.beanio.parser.Property#clearValue() */ + @Override public void clearValue(ParsingContext context) { } /* * (non-Javadoc) * @see org.beanio.parser.Property#createValue() */ + @Override public Object createValue(ParsingContext context) { return getValue(context); } @@ -66,6 +70,7 @@ public Object createValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser.Property#getValue() */ + @Override public Object getValue(ParsingContext context) { return value; } @@ -82,6 +87,7 @@ public void setValue(Object value) { * (non-Javadoc) * @see org.beanio.parser.Property#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { } @@ -90,6 +96,7 @@ public void setValue(ParsingContext context, Object value) { * (non-Javadoc) * @see org.beanio.parser.Property#getType() */ + @Override public Class getType() { return type; } @@ -98,6 +105,7 @@ public Class getType() { * (non-Javadoc) * @see org.beanio.parser.Property#setType(java.lang.Class) */ + @Override public void setType(Class type) { this.type = type; } @@ -106,6 +114,7 @@ public void setType(Class type) { * (non-Javadoc) * @see org.beanio.parser.Property#isIdentifier() */ + @Override public boolean isIdentifier() { return identifier; } @@ -114,6 +123,7 @@ public boolean isIdentifier() { * (non-Javadoc) * @see org.beanio.parser.Property#setIdentifier(boolean) */ + @Override public void setIdentifier(boolean identifier) { this.identifier = identifier; } @@ -122,6 +132,7 @@ public void setIdentifier(boolean identifier) { * (non-Javadoc) * @see org.beanio.parser.Property#getAccessor() */ + @Override public PropertyAccessor getAccessor() { return accessor; } @@ -130,6 +141,7 @@ public PropertyAccessor getAccessor() { * (non-Javadoc) * @see org.beanio.parser.Property#setAccessor(org.beanio.parser.PropertyAccessor) */ + @Override public void setAccessor(PropertyAccessor accessor) { this.accessor = accessor; } diff --git a/src/org/beanio/internal/parser/DelegatingParser.java b/src/org/beanio/internal/parser/DelegatingParser.java index fac4dcf..358afc0 100644 --- a/src/org/beanio/internal/parser/DelegatingParser.java +++ b/src/org/beanio/internal/parser/DelegatingParser.java @@ -31,42 +31,52 @@ public DelegatingParser() { super(1); } + @Override public boolean matches(UnmarshallingContext context) { return getParser().matches(context); } + @Override public boolean unmarshal(UnmarshallingContext context) { return getParser().unmarshal(context); } + @Override public boolean marshal(MarshallingContext context) throws IOException { return getParser().marshal(context); } + @Override public void clearValue(ParsingContext context) { getParser().clearValue(context); } + @Override public void setValue(ParsingContext context, Object value) { getParser().setValue(context, value); } + @Override public Object getValue(ParsingContext context) { return getParser().getValue(context); } + @Override public int getSize() { return getParser().getSize(); } + @Override public boolean isOptional() { return getParser().isOptional(); } + @Override public boolean isIdentifier() { return getParser().isIdentifier(); } + @Override public boolean hasContent(ParsingContext context) { return getParser().hasContent(context); } diff --git a/src/org/beanio/internal/parser/ErrorContext.java b/src/org/beanio/internal/parser/ErrorContext.java index 38d29db..b8fa3e5 100644 --- a/src/org/beanio/internal/parser/ErrorContext.java +++ b/src/org/beanio/internal/parser/ErrorContext.java @@ -85,6 +85,7 @@ public ErrorContext copy() { * Returns the raw text of the last record read from the record reader. * @return the raw text of the last record read */ + @Override public String getRecordText() { return recordText; } @@ -101,6 +102,7 @@ public void setRecordText(String text) { * Returns the starting line number of the last record read from the record reader. * @return the line number of the last record */ + @Override public int getRecordLineNumber() { return lineNumber; } @@ -119,6 +121,7 @@ public void setLineNumber(int lineNumber) { * or null if not known. * @return the name of the record */ + @Override public String getRecordName() { return recordName; } @@ -198,6 +201,7 @@ public void setFieldText(String fieldName, String text, boolean repeating) { * (non-Javadoc) * @see org.beanio.RecordContext#hasErrors() */ + @Override public boolean hasErrors() { return hasRecordErrors() || hasFieldErrors(); } @@ -206,6 +210,7 @@ public boolean hasErrors() { * (non-Javadoc) * @see org.beanio.BeanReaderContext#hasRecordErrors() */ + @Override public boolean hasRecordErrors() { return recordErrors != null && !recordErrors.isEmpty(); } @@ -214,6 +219,7 @@ public boolean hasRecordErrors() { * (non-Javadoc) * @see org.beanio.BeanReaderContext#getRecordErrors() */ + @Override public Collection getRecordErrors() { if (recordErrors == null) return Collections.emptyList(); @@ -224,6 +230,7 @@ public Collection getRecordErrors() { * (non-Javadoc) * @see org.beanio.RecordContext#getFieldCount(java.lang.String) */ + @Override public int getFieldCount(String fieldName) { if (fieldTextMap == null) { return 0; @@ -243,6 +250,7 @@ public int getFieldCount(String fieldName) { * (non-Javadoc) * @see org.beanio.BeanReaderContext#getFieldText(java.lang.String) */ + @Override public String getFieldText(String fieldName) { return getFieldText(fieldName, 0); } @@ -251,6 +259,7 @@ public String getFieldText(String fieldName) { * (non-Javadoc) * @see org.beanio.BeanReaderContext#getFieldText(java.lang.String, int) */ + @Override public String getFieldText(String fieldName, int index) { if (fieldTextMap == null) { return null; @@ -267,6 +276,7 @@ else if (index == 0) { * (non-Javadoc) * @see org.beanio.BeanReaderContext#hasFieldErrors() */ + @Override public boolean hasFieldErrors() { return fieldErrorMap != null && !fieldErrorMap.isEmpty(); } @@ -275,6 +285,7 @@ public boolean hasFieldErrors() { * (non-Javadoc) * @see org.beanio.BeanReaderContext#getFieldErrors() */ + @Override public Map> getFieldErrors() { if (fieldErrorMap == null) { return Collections.emptyMap(); @@ -286,6 +297,7 @@ public Map> getFieldErrors() { * (non-Javadoc) * @see org.beanio.BeanReaderContext#getFieldErrors(java.lang.String) */ + @Override public Collection getFieldErrors(String fieldName) { if (fieldErrorMap == null) return null; @@ -297,6 +309,7 @@ public Collection getFieldErrors(String fieldName) { * (non-Javadoc) * @see org.beanio.RecordContext#getLineNumber() */ + @Override public int getLineNumber() { return getRecordLineNumber(); } diff --git a/src/org/beanio/internal/parser/Field.java b/src/org/beanio/internal/parser/Field.java index 7a23db2..3b31cf4 100644 --- a/src/org/beanio/internal/parser/Field.java +++ b/src/org/beanio/internal/parser/Field.java @@ -81,6 +81,7 @@ public Field() { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#hasContent() */ + @Override public boolean hasContent(ParsingContext context) { if (isBound()) { return getValue(context) != Value.MISSING; @@ -96,6 +97,7 @@ public boolean hasContent(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Property#type() */ + @Override public int type() { return Property.SIMPLE; } @@ -104,6 +106,7 @@ public int type() { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#isOptional() */ + @Override public boolean isOptional() { return format.isLazy(); } @@ -112,6 +115,7 @@ public boolean isOptional() { * (non-Javadoc) * @see org.beanio.parser2.Property#defines(java.lang.Object) */ + @Override public boolean defines(Object value) { if (value == null) { return false; @@ -134,6 +138,7 @@ public boolean defines(Object value) { * @return true if the field text is a match or this field is not used * to identify the record */ + @Override public boolean matches(UnmarshallingContext context) { if (isIdentifier()) { return isMatch(format.extract(context, false)); @@ -169,6 +174,7 @@ protected boolean isMatch(String text) { * (non-Javadoc) * @see org.beanio.parser2.Marshaller#marshal(org.beanio.parser2.MarshallingContext) */ + @Override public boolean marshal(MarshallingContext context) { String text; if (literal != null) { @@ -245,6 +251,7 @@ public boolean hasNext(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Unmarshaller#unmarshal(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean unmarshal(UnmarshallingContext context) { String text = format.extract(context, true); if (text == null) { @@ -411,6 +418,7 @@ else if (value != null) { * (non-Javadoc) * @see org.beanio.parser.Parser#clearValue() */ + @Override public void clearValue(ParsingContext context) { this.value.set(context, Value.MISSING); } @@ -419,6 +427,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#createValue() */ + @Override public Object createValue(ParsingContext context) { return getValue(context); } @@ -427,6 +436,7 @@ public Object createValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser.Parser#getValue() */ + @Override public Object getValue(ParsingContext context) { return value.get(context); } @@ -435,6 +445,7 @@ public Object getValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser.Parser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { this.value.set(context, value == null ? Value.MISSING : value); } @@ -490,10 +501,12 @@ public Class getPropertyType() { return propertyType; } + @Override public boolean isIdentifier() { return identifier; } + @Override public void setIdentifier(boolean recordIdentifier) { this.identifier = recordIdentifier; } @@ -514,6 +527,7 @@ public void setLiteral(String literal) { this.literal = literal; } + @Override public Class getType() { return propertyType; } @@ -562,14 +576,17 @@ public void setRegex(Pattern regex) { this.regex = regex; } + @Override public void setType(Class type) { this.propertyType = type; } + @Override public PropertyAccessor getAccessor() { return accessor; } + @Override public void setAccessor(PropertyAccessor accessor) { this.accessor = accessor; } @@ -600,6 +617,7 @@ public void setHandler(TypeHandler handler) { this.handler = handler; } + @Override protected void toParamString(StringBuilder s) { super.toParamString(s); s.append(", type=").append(propertyType != null ? propertyType.getSimpleName() : null); @@ -622,6 +640,7 @@ protected void toParamString(StringBuilder s) { s.append(", format=").append(format); } + @Override public int getSize() { return format.getSize(); } diff --git a/src/org/beanio/internal/parser/Group.java b/src/org/beanio/internal/parser/Group.java index b2e573d..c72312c 100644 --- a/src/org/beanio/internal/parser/Group.java +++ b/src/org/beanio/internal/parser/Group.java @@ -54,6 +54,7 @@ public Group() { * (non-Javadoc) * @see org.beanio.parser2.Marshaller#marshal(org.beanio.parser2.MarshallingContext) */ + @Override public boolean marshal(MarshallingContext context) throws IOException { // this method is only invoked when this group is configured to // marshal a bean object that spans multiple records @@ -70,6 +71,7 @@ public boolean marshal(MarshallingContext context) throws IOException { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#skip(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public void skip(UnmarshallingContext context) { // this method is only invoked when this group is configured to // unmarshal a bean object that spans multiple records @@ -109,6 +111,7 @@ public void skip(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Unmarshaller#unmarshal(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean unmarshal(UnmarshallingContext context) { // this method is only invoked when this group is configured to // unmarshal a bean object that spans multiple records @@ -157,6 +160,7 @@ public boolean unmarshal(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.RecordMatcher#matchAny(org.beanio.parser2.UnmarshallingContext) */ + @Override public Selector matchAny(UnmarshallingContext context) { for (Component n : getChildren()) { Selector node = (Selector) n; @@ -173,6 +177,7 @@ public Selector matchAny(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.RecordMatcher#matchNext(org.beanio.parser2.UnmarshallingContext) */ + @Override public Selector matchNext(UnmarshallingContext context) { try { return internalMatchNext(context); @@ -186,6 +191,7 @@ public Selector matchNext(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.RecordMatcher#matchNextBean(java.lang.Object) */ + @Override public Selector matchNext(MarshallingContext context) { try { if (property == null) { @@ -419,6 +425,7 @@ private Selector matchNext(ParsingContext context, Selector child) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#reset() */ + @Override public void reset(ParsingContext context) { lastMatched.set(context, null); for (Component c : getChildren()) { @@ -432,6 +439,7 @@ public void reset(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.RecordMatcher#close() */ + @Override public Selector close(ParsingContext context) { Selector lastMatch = lastMatched.get(context); @@ -483,6 +491,7 @@ private Selector findUnsatisfiedChild(ParsingContext context, int from) { * (non-Javadoc) * @see org.beanio.parser2.Unmarshaller#matches(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { return false; } @@ -491,6 +500,7 @@ public boolean matches(UnmarshallingContext context) { * Tests if the max occurs has been reached for this node. * @return true if max occurs has been reached */ + @Override public boolean isMaxOccursReached(ParsingContext context) { return lastMatched.get(context) == null && getCount(context) >= getMaxOccurs(); } @@ -499,6 +509,7 @@ public boolean isMaxOccursReached(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Unmarshaller#getSize() */ + @Override public int getSize() { return -1; } @@ -510,6 +521,7 @@ public int getSize() { * @param state the Map to update with the latest state * @since 1.2 */ + @Override public void updateState(ParsingContext context, String namespace, Map state) { state.put(getKey(namespace, COUNT_KEY), count.get(context)); @@ -533,6 +545,7 @@ public void updateState(ParsingContext context, String namespace, Map state) { String key = getKey(namespace, COUNT_KEY); Integer n = (Integer) state.get(key); @@ -577,25 +590,34 @@ protected String getKey(String namespace, String name) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isRecordGroup() */ + @Override public boolean isRecordGroup() { return true; } + @Override public int getMinOccurs() { return minOccurs; } + public void setMinOccurs(int minOccurs) { this.minOccurs = minOccurs; } + + @Override public int getMaxOccurs() { return maxOccurs; } + public void setMaxOccurs(int maxOccurs) { this.maxOccurs = maxOccurs; } + + @Override public int getOrder() { return order; } + public void setOrder(int order) { this.order = order; } @@ -604,6 +626,7 @@ public void setOrder(int order) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getCount() */ + @Override public int getCount(ParsingContext context) { return count.get(context); } @@ -612,6 +635,7 @@ public int getCount(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#setCount(int) */ + @Override public void setCount(ParsingContext context, int count) { this.count.set(context, count); } @@ -620,6 +644,7 @@ public void setCount(ParsingContext context, int count) { * (non-Javadoc) * @see org.beanio.parser2.Parser#clearValue() */ + @Override public void clearValue(ParsingContext context) { if (property != null) { property.clearValue(context); @@ -630,6 +655,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Parser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { property.setValue(context, value); } @@ -638,11 +664,13 @@ public void setValue(ParsingContext context, Object value) { * (non-Javadoc) * @see org.beanio.parser2.Parser#getValue() */ + @Override public Object getValue(ParsingContext context) { return property.getValue(context); } + @Override public Property getProperty() { return property; } @@ -654,6 +682,7 @@ public void setProperty(Property property) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#isLazy() */ + @Override public boolean isOptional() { return minOccurs == 0; } @@ -662,6 +691,7 @@ public boolean isOptional() { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#isIdentifier() */ + @Override public boolean isIdentifier() { return false; } @@ -670,6 +700,7 @@ public boolean isIdentifier() { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#hasContent() */ + @Override public boolean hasContent(ParsingContext context) { if (property != null) { return property.getValue(context) != Value.MISSING; diff --git a/src/org/beanio/internal/parser/MapParser.java b/src/org/beanio/internal/parser/MapParser.java index 45137e2..723a607 100644 --- a/src/org/beanio/internal/parser/MapParser.java +++ b/src/org/beanio/internal/parser/MapParser.java @@ -50,6 +50,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Property#defines(java.lang.Object) */ + @Override public boolean defines(Object value) { if (value == null || type == null) { return false; @@ -68,6 +69,7 @@ public boolean defines(Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.DelegatingParser#matches(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { // matching repeating fields is not supported return true; @@ -182,6 +184,7 @@ else if (invalid) { * Returns whether this iteration is a property of a bean object. * @return true if this iteration is a property, false otherwise */ + @Override public boolean isProperty() { return type != null; } @@ -190,6 +193,7 @@ public boolean isProperty() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#getType() */ + @Override public Class> getType() { return type; } @@ -198,6 +202,7 @@ public Class> getType() { * Sets the concrete {@link Map} type. */ @SuppressWarnings("unchecked") + @Override public void setType(Class mapType) { this.type = (Class>) mapType; } @@ -206,6 +211,7 @@ public void setType(Class mapType) { * (non-Javadoc) * @see org.beanio.parser2.Property#create() */ + @Override public Object createValue(ParsingContext context) { Object value = this.value.get(context); if (value == null) { @@ -219,6 +225,7 @@ public Object createValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.DelegatingParser#getValue() */ + @Override public Object getValue(ParsingContext context) { Object value = this.value.get(context); return value == null ? Value.MISSING : value; @@ -228,6 +235,7 @@ public Object getValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.DelegatingParser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { // convert empty collections to null so that parent parsers // will consider this property missing during marshalling @@ -269,6 +277,7 @@ protected int length(Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.Iteration#getIterationSize() */ + @Override public int getIterationSize() { return getSize(); } @@ -277,6 +286,7 @@ public int getIterationSize() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#type() */ + @Override public int type() { return Property.AGGREGATION_MAP; } diff --git a/src/org/beanio/internal/parser/MarshallerImpl.java b/src/org/beanio/internal/parser/MarshallerImpl.java index bb9d78b..b94302c 100644 --- a/src/org/beanio/internal/parser/MarshallerImpl.java +++ b/src/org/beanio/internal/parser/MarshallerImpl.java @@ -48,10 +48,13 @@ public MarshallerImpl(MarshallingContext context, Selector layout, final RecordM this.recordMarshaller = recordMarshaller; this.context.setRecordWriter(new RecordWriter() { + @Override public void write(Object record) { recordValue = record; } + @Override public void flush() { } + @Override public void close() { } }); } @@ -60,6 +63,7 @@ public void close() { } * (non-Javadoc) * @see org.beanio.Marshaller#marshal(java.lang.Object) */ + @Override public Marshaller marshal(Object bean) throws BeanWriterException { return marshal(null, bean); } @@ -68,6 +72,7 @@ public Marshaller marshal(Object bean) throws BeanWriterException { * (non-Javadoc) * @see org.beanio.Marshaller#marshal(java.lang.String, java.lang.Object) */ + @Override public Marshaller marshal(String recordName, Object bean) throws BeanWriterException { recordValue = null; @@ -126,6 +131,7 @@ public Marshaller marshal(String recordName, Object bean) throws BeanWriterExcep * (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { return (recordValue == null) ? null : recordMarshaller.marshal(recordValue); } @@ -134,6 +140,7 @@ public String toString() { * (non-Javadoc) * @see org.beanio.Marshaller#toArray() */ + @Override public String[] toArray() throws BeanWriterException { String[] array = context.toArray(recordValue); if (array == null) { @@ -146,6 +153,7 @@ public String[] toArray() throws BeanWriterException { * (non-Javadoc) * @see org.beanio.Marshaller#toList() */ + @Override public List toList() throws BeanWriterException { List list = context.toList(recordValue); if (list == null) { @@ -158,6 +166,7 @@ public List toList() throws BeanWriterException { * (non-Javadoc) * @see org.beanio.Marshaller#toDocument() */ + @Override public Document toDocument() throws BeanWriterException { Document document = context.toDocument(recordValue); if (document == null) { @@ -174,9 +183,11 @@ protected Object getRecordValue() { return recordValue; } + @Override public void debug() { debug(System.out); } + @Override public void debug(PrintStream out) { ((Component)layout).print(out); } diff --git a/src/org/beanio/internal/parser/MarshallingContext.java b/src/org/beanio/internal/parser/MarshallingContext.java index 644d478..762a40b 100644 --- a/src/org/beanio/internal/parser/MarshallingContext.java +++ b/src/org/beanio/internal/parser/MarshallingContext.java @@ -50,6 +50,7 @@ public final char getMode() { /** * Clear is invoked after each bean object (record or group) is marshalled. */ + @Override public void clear() { this.bean = null; this.componentName = null; diff --git a/src/org/beanio/internal/parser/PropertyComponent.java b/src/org/beanio/internal/parser/PropertyComponent.java index 8c2aee0..d395b65 100644 --- a/src/org/beanio/internal/parser/PropertyComponent.java +++ b/src/org/beanio/internal/parser/PropertyComponent.java @@ -50,6 +50,7 @@ public PropertyComponent() { } * (non-Javadoc) * @see org.beanio.internal.parser.Property#isIdentifier() */ + @Override public boolean isIdentifier() { return identifier; } @@ -58,6 +59,7 @@ public boolean isIdentifier() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#setIdentifier(boolean) */ + @Override public void setIdentifier(boolean identifier) { this.identifier = identifier; } @@ -66,6 +68,7 @@ public void setIdentifier(boolean identifier) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#getAccessor() */ + @Override public PropertyAccessor getAccessor() { return accessor; } @@ -74,6 +77,7 @@ public PropertyAccessor getAccessor() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#setAccessor(org.beanio.internal.parser.PropertyAccessor) */ + @Override public void setAccessor(PropertyAccessor accessor) { this.accessor = accessor; } @@ -82,6 +86,7 @@ public void setAccessor(PropertyAccessor accessor) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#getType() */ + @Override public Class getType() { return type; } @@ -90,6 +95,7 @@ public Class getType() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#setType(java.lang.Class) */ + @Override public void setType(Class type) { this.type = type; } diff --git a/src/org/beanio/internal/parser/Record.java b/src/org/beanio/internal/parser/Record.java index 6d895f7..dbb256a 100644 --- a/src/org/beanio/internal/parser/Record.java +++ b/src/org/beanio/internal/parser/Record.java @@ -47,6 +47,7 @@ public Record() { } * (non-Javadoc) * @see org.beanio.parser2.Marshaller#marshal(org.beanio.parser2.MarshallingContext) */ + @Override public boolean marshal(MarshallingContext context) throws IOException { try { boolean marshalled = super.marshal(context); @@ -65,6 +66,7 @@ public boolean marshal(MarshallingContext context) throws IOException { * (non-Javadoc) * @see org.beanio.parser2.Unmarshaller#unmarshal(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean unmarshal(UnmarshallingContext context) { try { // update the record context before unmarshalling @@ -92,6 +94,7 @@ public boolean unmarshal(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#skip(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public void skip(UnmarshallingContext context) { context.recordSkipped(); } @@ -100,6 +103,7 @@ public void skip(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchNext(org.beanio.internal.parser.MarshallingContext) */ + @Override public Selector matchNext(MarshallingContext context) { Property property = getProperty(); if (property != null) { @@ -129,6 +133,7 @@ else if (context.getBean() == null) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchNext(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public Selector matchNext(UnmarshallingContext context) { if (matches(context)) { setCount(context, getCount(context) + 1); @@ -141,6 +146,7 @@ public Selector matchNext(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Unmarshaller#matches(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { if (format != null) { if (!format.matches(context)) { @@ -154,6 +160,7 @@ public boolean matches(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchAny(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public Selector matchAny(UnmarshallingContext context) { return matches(context) ? this : null; } @@ -162,6 +169,7 @@ public Selector matchAny(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#close(org.beanio.internal.parser.ParsingContext) */ + @Override public Selector close(ParsingContext context) { return getCount(context) < getMinOccurs() ? this : null; } @@ -170,6 +178,7 @@ public Selector close(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#reset(org.beanio.internal.parser.ParsingContext) */ + @Override public void reset(ParsingContext context) { } /** @@ -179,6 +188,7 @@ public void reset(ParsingContext context) { } * @param state the Map to update with the latest state * @since 1.2 */ + @Override public void updateState(ParsingContext context, String namespace, Map state) { state.put(getKey(namespace, COUNT_KEY), count.get(context)); } @@ -190,6 +200,7 @@ public void updateState(ParsingContext context, String namespace, Map state) { String key = getKey(namespace, COUNT_KEY); Integer n = (Integer) state.get(key); @@ -213,31 +224,37 @@ protected String getKey(String namespace, String name) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isRecordGroup() */ + @Override public boolean isRecordGroup() { return false; } + @Override public int getMinOccurs() { return minOccurs; } public void setMinOccurs(int minOccurs) { this.minOccurs = minOccurs; } + @Override public int getMaxOccurs() { return maxOccurs; } public void setMaxOccurs(int maxOccurs) { this.maxOccurs = maxOccurs; } + @Override public int getOrder() { return order; } public void setOrder(int order) { this.order = order; } + @Override public int getCount(ParsingContext context) { return count.get(context); } + @Override public void setCount(ParsingContext context, int count) { this.count.set(context, count); } @@ -259,6 +276,7 @@ public void registerLocals(Set> locals) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isMaxOccursReached() */ + @Override public boolean isMaxOccursReached(ParsingContext context) { return getCount(context) >= getMaxOccurs(); } diff --git a/src/org/beanio/internal/parser/RecordAggregation.java b/src/org/beanio/internal/parser/RecordAggregation.java index abe2596..605f350 100644 --- a/src/org/beanio/internal/parser/RecordAggregation.java +++ b/src/org/beanio/internal/parser/RecordAggregation.java @@ -44,6 +44,7 @@ public RecordAggregation() { } * Sets the collection type. * @param type {@link Collection} class type */ + @Override public void setType(Class type) { this.type = type; } @@ -52,6 +53,7 @@ public void setType(Class type) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#getType() */ + @Override public Class getType() { return type; } @@ -60,6 +62,7 @@ public Class getType() { * (non-Javadoc) * @see org.beanio.internal.parser.Property#createValue() */ + @Override public Object createValue(ParsingContext context) { if (value.get(context) == Value.MISSING) { value.set(context, createAggregationType()); @@ -98,6 +101,7 @@ public void setValue(ParsingContext context, Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getProperty() */ + @Override public Property getProperty() { // for now, a collection cannot be a property root so its safe to return null here return null; @@ -107,6 +111,7 @@ public Property getProperty() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchNextRecord(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public Selector matchNext(UnmarshallingContext context) { if (getSelector().matchNext(context) != null) { return this; @@ -118,6 +123,7 @@ public Selector matchNext(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchAny(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public Selector matchAny(UnmarshallingContext context) { return getSelector().matchAny(context); } @@ -126,6 +132,7 @@ public Selector matchAny(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchNextBean(org.beanio.internal.parser.MarshallingContext, java.lang.Object) */ + @Override public Selector matchNext(MarshallingContext context) { return getSelector().matchNext(context); } @@ -134,6 +141,7 @@ public Selector matchNext(MarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#close(org.beanio.internal.parser.ParsingContext) */ + @Override public Selector close(ParsingContext context) { return getSelector().close(context); } @@ -142,6 +150,7 @@ public Selector close(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#reset(org.beanio.internal.parser.ParsingContext) */ + @Override public void reset(ParsingContext context) { getSelector().reset(context); } @@ -150,6 +159,7 @@ public void reset(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getCount(org.beanio.internal.parser.ParsingContext) */ + @Override public int getCount(ParsingContext context) { return getSelector().getCount(context); } @@ -158,6 +168,7 @@ public int getCount(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#setCount(org.beanio.internal.parser.ParsingContext, int) */ + @Override public void setCount(ParsingContext context, int count) { getSelector().setCount(context, count); } @@ -166,6 +177,7 @@ public void setCount(ParsingContext context, int count) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getOrder() */ + @Override public int getOrder() { return getSelector().getOrder(); } @@ -174,6 +186,7 @@ public int getOrder() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isMaxOccursReached(org.beanio.internal.parser.ParsingContext) */ + @Override public boolean isMaxOccursReached(ParsingContext context) { return getSelector().isMaxOccursReached(context); } @@ -182,6 +195,7 @@ public boolean isMaxOccursReached(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.util.StatefulWriter#updateState(java.lang.String, java.util.Map) */ + @Override public void updateState(ParsingContext context, String namespace, Map state) { getSelector().updateState(context, namespace, state); } @@ -190,6 +204,7 @@ public void updateState(ParsingContext context, String namespace, Map state) throws IllegalStateException { getSelector().restoreState(context, namespace, state); } @@ -198,6 +213,7 @@ public void restoreState(ParsingContext context, String namespace, Map> locals) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#skip(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public void skip(UnmarshallingContext context) { getSelector().skip(context); } @@ -288,6 +310,7 @@ public void skip(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isRecordGroup() */ + @Override public boolean isRecordGroup() { return false; } diff --git a/src/org/beanio/internal/parser/RecordCollection.java b/src/org/beanio/internal/parser/RecordCollection.java index bf3bae9..46c7bef 100644 --- a/src/org/beanio/internal/parser/RecordCollection.java +++ b/src/org/beanio/internal/parser/RecordCollection.java @@ -122,6 +122,7 @@ protected Collection getCollection(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#type() */ + @Override public int type() { return Property.AGGREGATION_COLLECTION; } diff --git a/src/org/beanio/internal/parser/RecordMap.java b/src/org/beanio/internal/parser/RecordMap.java index 3ce6b05..ec01bfb 100644 --- a/src/org/beanio/internal/parser/RecordMap.java +++ b/src/org/beanio/internal/parser/RecordMap.java @@ -131,6 +131,7 @@ protected Map getMap(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Property#type() */ + @Override public int type() { return Property.AGGREGATION_MAP; } diff --git a/src/org/beanio/internal/parser/Segment.java b/src/org/beanio/internal/parser/Segment.java index 35cc872..caa86ba 100644 --- a/src/org/beanio/internal/parser/Segment.java +++ b/src/org/beanio/internal/parser/Segment.java @@ -50,6 +50,7 @@ public class Segment extends ParserComponent { private Property property; // temporarily stores missing children during unmarshalling private ParserLocal> missing = new ParserLocal>() { + @Override protected List createDefaultValue() { return new ArrayList<>(); } @@ -64,6 +65,7 @@ public Segment() { } * (non-Javadoc) * @see org.beanio.internal.parser.Parser#clearValue() */ + @Override public void clearValue(ParsingContext context) { if (property != null) { property.clearValue(context); @@ -74,6 +76,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Parser#matches(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { if (isIdentifier()) { for (Component node : getChildren()) { @@ -89,6 +92,7 @@ public boolean matches(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Parser#unmarshal(org.beanio.parser2.UnmarshallingContext) */ + @Override public boolean unmarshal(UnmarshallingContext context) { List missing = this.missing.get(context); @@ -134,6 +138,7 @@ else if (!parser.isOptional()) { * (non-Javadoc) * @see org.beanio.parser2.Parser#marshal(org.beanio.parser2.MarshallingContext) */ + @Override public boolean marshal(MarshallingContext context) throws IOException { // since we allow Collections containing a null reference to force // output of a bean, we also check that we are not repeating @@ -154,6 +159,7 @@ public boolean marshal(MarshallingContext context) throws IOException { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#hasContent() */ + @Override public boolean hasContent(ParsingContext context) { if (property != null) { return property.getValue(context) != Value.MISSING; @@ -172,6 +178,7 @@ public boolean hasContent(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Parser#getValue() */ + @Override public Object getValue(ParsingContext context) { // getValue() may be called for a record where no property is set if (property == null) { @@ -186,6 +193,7 @@ public Object getValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.parser2.Parser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { if (property != null) { property.setValue(context, value); @@ -204,6 +212,7 @@ public void setProperty(Property property) { * (non-Javadoc) * @see org.beanio.parser.Parser#isLazy() */ + @Override public boolean isOptional() { return optional; } @@ -220,10 +229,12 @@ public void setSize(int size) { * (non-Javadoc) * @see org.beanio.parser.Parser#getSize() */ + @Override public int getSize() { return size; } + @Override public boolean isIdentifier() { return identifier; } diff --git a/src/org/beanio/internal/parser/StreamFormatSupport.java b/src/org/beanio/internal/parser/StreamFormatSupport.java index 9966042..cf56fbb 100644 --- a/src/org/beanio/internal/parser/StreamFormatSupport.java +++ b/src/org/beanio/internal/parser/StreamFormatSupport.java @@ -47,6 +47,7 @@ public void setName(String name) { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#getName() */ + @Override public String getName() { return name; } @@ -57,6 +58,7 @@ public String getName() { * @param in the input stream to read from * @return a new RecordReader */ + @Override public RecordReader createRecordReader(Reader in) { return recordParserFactory.createReader(in); } @@ -67,6 +69,7 @@ public RecordReader createRecordReader(Reader in) { * @param out the output stream to write to * @return a new RecordWriter */ + @Override public RecordWriter createRecordWriter(Writer out) { return recordParserFactory.createWriter(out); } @@ -75,6 +78,7 @@ public RecordWriter createRecordWriter(Writer out) { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createRecordMarshaller() */ + @Override public RecordMarshaller createRecordMarshaller() { return recordParserFactory.createMarshaller(); } @@ -83,6 +87,7 @@ public RecordMarshaller createRecordMarshaller() { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createRecordUnmarshaller() */ + @Override public RecordUnmarshaller createRecordUnmarshaller() { return recordParserFactory.createUnmarshaller(); } diff --git a/src/org/beanio/internal/parser/UnmarshallerImpl.java b/src/org/beanio/internal/parser/UnmarshallerImpl.java index 1087e53..7600db3 100644 --- a/src/org/beanio/internal/parser/UnmarshallerImpl.java +++ b/src/org/beanio/internal/parser/UnmarshallerImpl.java @@ -48,6 +48,7 @@ public UnmarshallerImpl(UnmarshallingContext context, Selector layout, final Rec this.layout = layout; this.context.setRecordReader(new RecordReader() { + @Override public Object read() throws RecordIOException { try { Object value = recordValue; @@ -61,12 +62,15 @@ public Object read() throws RecordIOException { recordValue = null; } } + @Override public int getRecordLineNumber() { return 0; } + @Override public String getRecordText() { return recordText; } + @Override public void close() throws IOException { } }); } @@ -75,6 +79,7 @@ public void close() throws IOException { } * (non-Javadoc) * @see org.beanio.Unmarshaller#unmarshal(java.lang.String) */ + @Override public Object unmarshal(String text) throws MalformedRecordException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException { @@ -92,6 +97,7 @@ public Object unmarshal(String text) throws MalformedRecordException, Unidentifi * (non-Javadoc) * @see org.beanio.Unmarshaller#unmarshal(java.util.List) */ + @Override public Object unmarshal(List list) throws BeanReaderException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException { @@ -113,6 +119,7 @@ public Object unmarshal(List list) throws BeanReaderException, Unidentif * (non-Javadoc) * @see org.beanio.Unmarshaller#unmarshal(java.lang.String[]) */ + @Override public Object unmarshal(String[] array) throws BeanReaderException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException { @@ -134,6 +141,7 @@ public Object unmarshal(String[] array) throws BeanReaderException, Unidentified * (non-Javadoc) * @see org.beanio.Unmarshaller#unmarshal(org.w3c.dom.Node) */ + @Override public Object unmarshal(Node node) throws BeanReaderException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException { @@ -216,6 +224,7 @@ private Object unmarshal() { * (non-Javadoc) * @see org.beanio.Unmarshaller#getRecordName() */ + @Override public String getRecordName() { return recordName; } @@ -224,13 +233,16 @@ public String getRecordName() { * (non-Javadoc) * @see org.beanio.Unmarshaller#getRecordContext() */ + @Override public RecordContext getRecordContext() { return context.getRecordContext(0); } + @Override public void debug() { debug(System.out); } + @Override public void debug(PrintStream out) { ((Component)layout).print(out); } diff --git a/src/org/beanio/internal/parser/accessor/FieldReflectionAccessor.java b/src/org/beanio/internal/parser/accessor/FieldReflectionAccessor.java index 68f9db6..a7b702b 100644 --- a/src/org/beanio/internal/parser/accessor/FieldReflectionAccessor.java +++ b/src/org/beanio/internal/parser/accessor/FieldReflectionAccessor.java @@ -44,6 +44,7 @@ public FieldReflectionAccessor(Field field, int constructorArgumentIndex) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyAccessor#getValue(java.lang.Object) */ + @Override public Object getValue(Object bean) { try { return field.get(bean); @@ -58,6 +59,7 @@ public Object getValue(Object bean) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyAccessor#setValue(java.lang.Object, java.lang.Object) */ + @Override public void setValue(Object bean, Object value) { try { field.set(bean, value); diff --git a/src/org/beanio/internal/parser/accessor/MapAccessor.java b/src/org/beanio/internal/parser/accessor/MapAccessor.java index d10c2c6..0def4e8 100644 --- a/src/org/beanio/internal/parser/accessor/MapAccessor.java +++ b/src/org/beanio/internal/parser/accessor/MapAccessor.java @@ -42,6 +42,7 @@ public MapAccessor(String key) { * @see org.beanio.parser.PropertyAccessor#getValue(java.lang.Object) */ @SuppressWarnings("rawtypes") + @Override public Object getValue(Object bean) { return ((Map)bean).get(key); } @@ -51,6 +52,7 @@ public Object getValue(Object bean) { * @see org.beanio.parser.PropertyAccessor#setValue(java.lang.Object, java.lang.Object) */ @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override public void setValue(Object bean, Object value) { ((Map)bean).put(key, value); } @@ -59,6 +61,7 @@ public void setValue(Object bean, Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyAccessor#isConstructorArgument() */ + @Override public boolean isConstructorArgument() { return false; } @@ -67,6 +70,7 @@ public boolean isConstructorArgument() { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyAccessor#getConstructorArgumentIndex() */ + @Override public int getConstructorArgumentIndex() { return -1; } diff --git a/src/org/beanio/internal/parser/accessor/MethodReflectionAccessor.java b/src/org/beanio/internal/parser/accessor/MethodReflectionAccessor.java index df53a02..d5d7f1f 100644 --- a/src/org/beanio/internal/parser/accessor/MethodReflectionAccessor.java +++ b/src/org/beanio/internal/parser/accessor/MethodReflectionAccessor.java @@ -52,6 +52,7 @@ public MethodReflectionAccessor(PropertyDescriptor descriptor, int constructorAr * (non-Javadoc) * @see org.beanio.parser.PropertyAccessor#getValue(java.lang.Object) */ + @Override public Object getValue(Object bean) { if (getter == null) { throw new BeanIOException("There is no readable property named '" + @@ -72,6 +73,7 @@ public Object getValue(Object bean) { * (non-Javadoc) * @see org.beanio.parser.PropertyAccessor#setValue(java.lang.Object, java.lang.Object) */ + @Override public void setValue(Object bean, Object value) { if (setter == null) { throw new BeanIOException( diff --git a/src/org/beanio/internal/parser/accessor/PropertyAccessorSupport.java b/src/org/beanio/internal/parser/accessor/PropertyAccessorSupport.java index ab068fa..b36f0ca 100644 --- a/src/org/beanio/internal/parser/accessor/PropertyAccessorSupport.java +++ b/src/org/beanio/internal/parser/accessor/PropertyAccessorSupport.java @@ -36,6 +36,7 @@ public PropertyAccessorSupport() { } * (non-Javadoc) * @see org.beanio.internal.parser.PropertyAccessor#isConstructorArgument() */ + @Override public boolean isConstructorArgument() { return getConstructorArgumentIndex() >= 0; } @@ -53,6 +54,7 @@ public void setConstructorArgumentIndex(int index) { * (non-Javadoc) * @see org.beanio.internal.parser.PropertyAccessor#getConstructorArgumentIndex() */ + @Override public int getConstructorArgumentIndex() { return constructorArgumentIndex; } diff --git a/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java b/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java index 24d4bfc..2d07f5a 100644 --- a/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/delimited/DelimitedMarshallingContext.java @@ -141,6 +141,7 @@ public Entry(int position, String text) { this.text = text; } + @Override public int compareTo(Entry o) { return Integer.valueOf(this.order).compareTo(o.order); } diff --git a/src/org/beanio/internal/parser/format/delimited/DelimitedRecordFormat.java b/src/org/beanio/internal/parser/format/delimited/DelimitedRecordFormat.java index 6d264fd..f3fae43 100644 --- a/src/org/beanio/internal/parser/format/delimited/DelimitedRecordFormat.java +++ b/src/org/beanio/internal/parser/format/delimited/DelimitedRecordFormat.java @@ -44,6 +44,7 @@ public DelimitedRecordFormat() { } * (non-Javadoc) * @see org.beanio.internal.parser.RecordFormat#matches(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { int length = ((DelimitedUnmarshallingContext)context).getFieldCount(); return !(length < minMatchLength || length > maxMatchLength); @@ -53,6 +54,7 @@ public boolean matches(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.RecordFormat#validate(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public void validate(UnmarshallingContext context) { int length = ((DelimitedUnmarshallingContext)context).getFieldCount(); diff --git a/src/org/beanio/internal/parser/format/delimited/DelimitedStreamFormat.java b/src/org/beanio/internal/parser/format/delimited/DelimitedStreamFormat.java index 2be28c0..92e6269 100644 --- a/src/org/beanio/internal/parser/format/delimited/DelimitedStreamFormat.java +++ b/src/org/beanio/internal/parser/format/delimited/DelimitedStreamFormat.java @@ -29,6 +29,7 @@ public class DelimitedStreamFormat extends StreamFormatSupport { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createUnmarshallingContext() */ + @Override public UnmarshallingContext createUnmarshallingContext() { return new DelimitedUnmarshallingContext(); } @@ -37,6 +38,7 @@ public UnmarshallingContext createUnmarshallingContext() { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createMarshallingContext() */ + @Override public MarshallingContext createMarshallingContext(boolean streaming) { return new DelimitedMarshallingContext(); } diff --git a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java index a244914..5ff29b6 100644 --- a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java +++ b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthMarshallingContext.java @@ -132,6 +132,7 @@ public Entry(int position, String text) { this.text = text; } + @Override public int compareTo(Entry o) { return Integer.valueOf(this.order).compareTo(o.order); } diff --git a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthRecordFormat.java b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthRecordFormat.java index c3d3568..3b094c2 100644 --- a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthRecordFormat.java +++ b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthRecordFormat.java @@ -43,6 +43,7 @@ public FixedLengthRecordFormat() { } * (non-Javadoc) * @see org.beanio.internal.parser.RecordFormat#matches(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { int length = ((FixedLengthUnmarshallingContext)context).getRecordLength(); return !(length < minMatchLength || length > maxMatchLength); @@ -52,6 +53,7 @@ public boolean matches(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.RecordFormat#validate(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public void validate(UnmarshallingContext context) { int length = ((FixedLengthUnmarshallingContext)context).getRecordLength(); diff --git a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthStreamFormat.java b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthStreamFormat.java index 72863c4..d6d443d 100644 --- a/src/org/beanio/internal/parser/format/fixedlength/FixedLengthStreamFormat.java +++ b/src/org/beanio/internal/parser/format/fixedlength/FixedLengthStreamFormat.java @@ -38,6 +38,7 @@ public FixedLengthStreamFormat() { } * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createUnmarshallingContext() */ + @Override public UnmarshallingContext createUnmarshallingContext() { return new FixedLengthUnmarshallingContext(); } @@ -46,6 +47,7 @@ public UnmarshallingContext createUnmarshallingContext() { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createMarshallingContext() */ + @Override public MarshallingContext createMarshallingContext(boolean streaming) { return new FixedLengthMarshallingContext(); } diff --git a/src/org/beanio/internal/parser/format/flat/FlatFieldFormatSupport.java b/src/org/beanio/internal/parser/format/flat/FlatFieldFormatSupport.java index cf1523e..f4628b4 100644 --- a/src/org/beanio/internal/parser/format/flat/FlatFieldFormatSupport.java +++ b/src/org/beanio/internal/parser/format/flat/FlatFieldFormatSupport.java @@ -39,6 +39,7 @@ public abstract class FlatFieldFormatSupport implements FlatFieldFormat { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#insertValue(org.beanio.internal.parser.MarshallingContext, java.lang.Object) */ + @Override public boolean insertValue(MarshallingContext context, Object value) { return false; } @@ -48,6 +49,7 @@ public boolean insertValue(MarshallingContext context, Object value) { * @param context the {@link MarshallingContext} holding the record * @param text the field text to insert into the record */ + @Override public void insertField(MarshallingContext context, String text) { boolean commit = text != null || !isLazy(); @@ -67,6 +69,7 @@ else if (text == null) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#extract(org.beanio.internal.parser.UnmarshallingContext, boolean) */ + @Override public String extract(UnmarshallingContext context, boolean reporting) { String text = extractFieldText(context, reporting); @@ -116,6 +119,7 @@ public void setName(String name) { * (non-Javadoc) * @see org.beanio.internal.parser.format.flat.FlatFieldFormat#getPosition() */ + @Override public int getPosition() { return position; } @@ -132,6 +136,7 @@ public void setUntil(int until) { this.until = until; } + @Override public int getSize() { return 1; } @@ -140,6 +145,7 @@ public int getSize() { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isNillable() */ + @Override public boolean isNillable() { return false; } @@ -164,6 +170,7 @@ public void setPadding(FieldPadding padding) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isLazy() */ + @Override public boolean isLazy() { return lazy; } diff --git a/src/org/beanio/internal/parser/format/json/JsonFieldFormat.java b/src/org/beanio/internal/parser/format/json/JsonFieldFormat.java index c69018c..4287407 100644 --- a/src/org/beanio/internal/parser/format/json/JsonFieldFormat.java +++ b/src/org/beanio/internal/parser/format/json/JsonFieldFormat.java @@ -59,6 +59,7 @@ public JsonFieldFormat() { } * @see org.beanio.internal.parser.FieldFormat#extract(org.beanio.internal.parser.UnmarshallingContext, boolean) */ @SuppressWarnings("unchecked") + @Override public String extract(UnmarshallingContext context, boolean reportErrors) { JsonUnmarshallingContext ctx = (JsonUnmarshallingContext) context; @@ -137,6 +138,7 @@ else if (length != padding.getLength()) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#insertValue(org.beanio.internal.parser.MarshallingContext, java.lang.Object) */ + @Override public boolean insertValue(MarshallingContext context, Object value) { if (!bypassTypeHandler) { return false; @@ -161,6 +163,7 @@ else if (value == null && isLazy()) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#insertField(org.beanio.internal.parser.MarshallingContext, java.lang.String) */ + @Override public void insertField(MarshallingContext context, String text) { JsonMarshallingContext ctx = (JsonMarshallingContext) context; @@ -211,6 +214,7 @@ public void insertField(MarshallingContext context, String text) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonType#getName() */ + @Override public String getName() { return name; } @@ -235,6 +239,7 @@ public void setLazy(boolean lazy) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#getSize() */ + @Override public int getSize() { return 1; } @@ -251,6 +256,7 @@ public void setNillable(boolean nillable) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isNillable() */ + @Override public boolean isNillable() { return nillable; } @@ -259,6 +265,7 @@ public boolean isNillable() { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isLazy() */ + @Override public boolean isLazy() { return lazy; } @@ -275,6 +282,7 @@ public void setJsonName(String jsonName) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonType#getJsonName() */ + @Override public String getJsonName() { return jsonName; } @@ -291,6 +299,7 @@ public void setJsonType(char jsonType) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonType#getJsonType() */ + @Override public char getJsonType() { return jsonType; } @@ -299,10 +308,12 @@ public void setJsonArray(boolean repeating) { this.jsonArray = repeating; } + @Override public boolean isJsonArray() { return jsonArray; } + @Override public int getJsonArrayIndex() { return jsonArrayIndex; } diff --git a/src/org/beanio/internal/parser/format/json/JsonStreamFormat.java b/src/org/beanio/internal/parser/format/json/JsonStreamFormat.java index fef36e7..950adbe 100644 --- a/src/org/beanio/internal/parser/format/json/JsonStreamFormat.java +++ b/src/org/beanio/internal/parser/format/json/JsonStreamFormat.java @@ -36,6 +36,7 @@ public JsonStreamFormat() { } * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createUnmarshallingContext() */ + @Override public UnmarshallingContext createUnmarshallingContext() { return new JsonUnmarshallingContext(maxDepth); } @@ -44,6 +45,7 @@ public UnmarshallingContext createUnmarshallingContext() { * (non-Javadoc) * @see org.beanio.internal.parser.StreamFormat#createMarshallingContext(boolean) */ + @Override public MarshallingContext createMarshallingContext(boolean streaming) { return new JsonMarshallingContext(maxDepth); } diff --git a/src/org/beanio/internal/parser/format/json/JsonWrapper.java b/src/org/beanio/internal/parser/format/json/JsonWrapper.java index 0515cfb..ffccf44 100644 --- a/src/org/beanio/internal/parser/format/json/JsonWrapper.java +++ b/src/org/beanio/internal/parser/format/json/JsonWrapper.java @@ -112,6 +112,7 @@ public boolean marshal(MarshallingContext context) throws IOException { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonNode#getJsonName() */ + @Override public String getJsonName() { return jsonName; } @@ -124,6 +125,7 @@ public void setJsonName(String jsonName) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonNode#getJsonType() */ + @Override public char getJsonType() { return jsonType; } @@ -136,6 +138,7 @@ public void setJsonType(char jsonType) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonNode#isJsonArray() */ + @Override public boolean isJsonArray() { return jsonArray; } @@ -148,6 +151,7 @@ public void setJsonArray(boolean jsonArray) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonNode#getJsonArrayIndex() */ + @Override public int getJsonArrayIndex() { return jsonArrayIndex; } @@ -160,6 +164,7 @@ public void setJsonArrayIndex(int jsonArrayIndex) { * (non-Javadoc) * @see org.beanio.internal.parser.format.json.JsonNode#isNillable() */ + @Override public boolean isNillable() { return nillable; } @@ -172,6 +177,7 @@ public void setNillable(boolean nillable) { * (non-Javadoc) * @see org.beanio.internal.parser.DelegatingParser#isLazy() */ + @Override public boolean isOptional() { return optional; } diff --git a/src/org/beanio/internal/parser/format/xml/XmlAttributeField.java b/src/org/beanio/internal/parser/format/xml/XmlAttributeField.java index c554ff1..684a831 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlAttributeField.java +++ b/src/org/beanio/internal/parser/format/xml/XmlAttributeField.java @@ -41,6 +41,7 @@ public XmlAttributeField() { } * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlFieldFormat#extractText(org.beanio.internal.parser.format.xml.XmlUnmarshallingContext) */ + @Override public String extractText(XmlUnmarshallingContext context) { Element parent = context.getPosition(); if (parent == null) { @@ -55,6 +56,7 @@ public String extractText(XmlUnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlFieldFormat#insertText(org.beanio.internal.parser.format.xml.XmlMarshallingContext, java.lang.String) */ + @Override public void insertText(XmlMarshallingContext ctx, String fieldText) { Element parent = (Element) ctx.getParent(); @@ -82,6 +84,7 @@ public void insertText(XmlMarshallingContext ctx, String fieldText) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getType() */ + @Override public int getType() { return XmlNode.XML_TYPE_ATTRIBUTE; } @@ -90,6 +93,7 @@ public int getType() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getLocalName() */ + @Override public String getLocalName() { return localName; } @@ -106,6 +110,7 @@ public void setLocalName(String localName) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getNamespace() */ + @Override public String getNamespace() { return namespace; } @@ -122,6 +127,7 @@ public void setNamespace(String namespace) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getPrefix() */ + @Override public String getPrefix() { return prefix; } @@ -138,6 +144,7 @@ public void setPrefix(String prefix) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isNamespaceAware() */ + @Override public boolean isNamespaceAware() { return namespaceAware; } @@ -154,6 +161,7 @@ public void setNamespaceAware(boolean namespaceAware) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isNillable() */ + @Override public boolean isNillable() { return false; } @@ -162,6 +170,7 @@ public boolean isNillable() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isRepeating() */ + @Override public boolean isRepeating() { return false; } diff --git a/src/org/beanio/internal/parser/format/xml/XmlElementField.java b/src/org/beanio/internal/parser/format/xml/XmlElementField.java index 4aa1bc5..f452db3 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlElementField.java +++ b/src/org/beanio/internal/parser/format/xml/XmlElementField.java @@ -48,6 +48,7 @@ public XmlElementField() { } * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlFieldFormat#extractText(org.beanio.internal.parser.format.xml.XmlUnmarshallingContext) */ + @Override public String extractText(XmlUnmarshallingContext context) { Element node = context.findElement(this); if (node == null) { @@ -70,6 +71,7 @@ public String extractText(XmlUnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlFieldFormat#insertText(org.beanio.internal.parser.format.xml.XmlMarshallingContext, java.lang.String) */ + @Override public void insertText(XmlMarshallingContext ctx, String fieldText) { if (fieldText == null && isLazy()) { return; @@ -108,6 +110,7 @@ else if (fieldText != null && fieldText.length() > 0) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isRepeating() */ + @Override public boolean isRepeating() { return repeating; } @@ -124,6 +127,7 @@ public void setRepeating(boolean repeating) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getType() */ + @Override public int getType() { return XmlNode.XML_TYPE_ELEMENT; } @@ -132,6 +136,7 @@ public int getType() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getLocalName() */ + @Override public String getLocalName() { return localName; } @@ -148,6 +153,7 @@ public void setLocalName(String localName) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getNamespace() */ + @Override public String getNamespace() { return namespace; } @@ -164,6 +170,7 @@ public void setNamespace(String namespace) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getPrefix() */ + @Override public String getPrefix() { return prefix; } @@ -180,6 +187,7 @@ public void setPrefix(String prefix) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isNillable() */ + @Override public boolean isNillable() { return nillable; } @@ -196,6 +204,7 @@ public void setNillable(boolean nillable) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isNamespaceAware() */ + @Override public boolean isNamespaceAware() { return namespaceAware; } diff --git a/src/org/beanio/internal/parser/format/xml/XmlFieldFormat.java b/src/org/beanio/internal/parser/format/xml/XmlFieldFormat.java index 7cb4920..37e0056 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlFieldFormat.java +++ b/src/org/beanio/internal/parser/format/xml/XmlFieldFormat.java @@ -40,6 +40,7 @@ public XmlFieldFormat() { } * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#insertValue(org.beanio.internal.parser.MarshallingContext, java.lang.Object) */ + @Override public boolean insertValue(MarshallingContext context, Object value) { return false; } @@ -48,6 +49,7 @@ public boolean insertValue(MarshallingContext context, Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#insertField(org.beanio.internal.parser.MarshallingContext, java.lang.String) */ + @Override public void insertField(MarshallingContext context, String fieldText) { XmlMarshallingContext ctx = (XmlMarshallingContext) context; @@ -69,6 +71,7 @@ public void insertField(MarshallingContext context, String fieldText) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#extract(org.beanio.internal.parser.UnmarshallingContext, boolean) */ + @Override public String extract(UnmarshallingContext context, boolean reportErrors) { XmlUnmarshallingContext ctx = (XmlUnmarshallingContext) context; @@ -107,6 +110,7 @@ else if (length != padding.getLength()) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#getSize() */ + @Override public int getSize() { return 1; } @@ -131,6 +135,7 @@ public void setName(String name) { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isLazy() */ + @Override public boolean isLazy() { return lazy; } diff --git a/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java b/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java index a92d92e..76805f7 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java +++ b/src/org/beanio/internal/parser/format/xml/XmlSelectorWrapper.java @@ -96,6 +96,7 @@ private void createBaseDocument(Document document, Node parent, Component node) * (non-Javadoc) * @see org.beanio.parser2.Marshaller#marshal(org.beanio.parser2.MarshallingContext) */ + @Override public boolean marshal(MarshallingContext context) throws IOException { XmlMarshallingContext ctx = (XmlMarshallingContext) context; @@ -133,6 +134,7 @@ public boolean marshal(MarshallingContext context) throws IOException { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#unmarshal(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public boolean unmarshal(UnmarshallingContext context) { return getDelegate().unmarshal(context); } @@ -141,6 +143,7 @@ public boolean unmarshal(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#skip(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public void skip(UnmarshallingContext context) { getDelegate().skip(context); } @@ -149,6 +152,7 @@ public void skip(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchNextBean(org.beanio.internal.parser.MarshallingContext, java.lang.Object) */ + @Override public Selector matchNext(MarshallingContext context) { XmlMarshallingContext ctx = (XmlMarshallingContext) context; @@ -196,6 +200,7 @@ public Selector matchNext(MarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchNext(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public Selector matchNext(UnmarshallingContext context) { return match(context, true); } @@ -204,6 +209,7 @@ public Selector matchNext(UnmarshallingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#matchAny(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public Selector matchAny(UnmarshallingContext context) { return match(context, false); } @@ -261,6 +267,7 @@ private Selector match(UnmarshallingContext context, boolean stateful) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#matches(org.beanio.internal.parser.UnmarshallingContext) */ + @Override public boolean matches(UnmarshallingContext context) { // a group is never used to match a record return false; @@ -273,6 +280,7 @@ public boolean matches(UnmarshallingContext context) { * @param state the Map to update with the latest state * @since 1.2 */ + @Override public void updateState(ParsingContext context, String namespace, Map state) { state.put(getKey(namespace, WRITTEN_KEY), written.get(context)); @@ -289,6 +297,7 @@ public void updateState(ParsingContext context, String namespace, Map state) { String key = getKey(namespace, WRITTEN_KEY); Boolean written = (Boolean) state.get(key); @@ -325,6 +334,7 @@ private final Selector getDelegate() { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#getValue() */ + @Override public Object getValue(ParsingContext context) { return getDelegate().getValue(context); } @@ -333,6 +343,7 @@ public Object getValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#setValue(java.lang.Object) */ + @Override public void setValue(ParsingContext context, Object value) { getDelegate().setValue(context, value); } @@ -341,6 +352,7 @@ public void setValue(ParsingContext context, Object value) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#getSize() */ + @Override public int getSize() { return getDelegate().getSize(); } @@ -349,6 +361,7 @@ public int getSize() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#close(org.beanio.internal.parser.ParsingContext) */ + @Override public Selector close(ParsingContext context) { return getDelegate().close(context); } @@ -357,6 +370,7 @@ public Selector close(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#reset(org.beanio.internal.parser.ParsingContext) */ + @Override public void reset(ParsingContext context) { written.set(context, false); getDelegate().reset(context); @@ -366,6 +380,7 @@ public void reset(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getCount(org.beanio.internal.parser.ParsingContext) */ + @Override public int getCount(ParsingContext context) { return getDelegate().getCount(context); } @@ -374,6 +389,7 @@ public int getCount(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#setCount(org.beanio.internal.parser.ParsingContext, int) */ + @Override public void setCount(ParsingContext context, int count) { getDelegate().setCount(context, count); } @@ -382,6 +398,7 @@ public void setCount(ParsingContext context, int count) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getMinOccurs() */ + @Override public int getMinOccurs() { return getDelegate().getMinOccurs(); } @@ -390,6 +407,7 @@ public int getMinOccurs() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getMaxOccurs() */ + @Override public int getMaxOccurs() { return getDelegate().getMaxOccurs(); } @@ -398,6 +416,7 @@ public int getMaxOccurs() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getOrder() */ + @Override public int getOrder() { return getDelegate().getOrder(); } @@ -406,6 +425,7 @@ public int getOrder() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isMaxOccursReached(org.beanio.internal.parser.ParsingContext) */ + @Override public boolean isMaxOccursReached(ParsingContext context) { return getDelegate().isMaxOccursReached(context); } @@ -414,6 +434,7 @@ public boolean isMaxOccursReached(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#clearValue() */ + @Override public void clearValue(ParsingContext context) { getDelegate().clearValue(context); } @@ -422,6 +443,7 @@ public void clearValue(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#isIdentifier() */ + @Override public boolean isIdentifier() { return getDelegate().isIdentifier(); } @@ -439,6 +461,7 @@ public void setGroup(boolean group) { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#isLazy() */ + @Override public boolean isOptional() { return getDelegate().isOptional(); } @@ -447,6 +470,7 @@ public boolean isOptional() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getLocalName() */ + @Override public String getLocalName() { return localName; } @@ -461,6 +485,7 @@ public void setLocalName(String localName) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getNamespace() */ + @Override public String getNamespace() { return namespace; } @@ -477,6 +502,7 @@ public void setNamespace(String namespace) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getPrefix() */ + @Override public String getPrefix() { return prefix; } @@ -493,6 +519,7 @@ public void setPrefix(String prefix) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isNamespaceAware() */ + @Override public boolean isNamespaceAware() { return namespaceAware; } @@ -509,6 +536,7 @@ public void setNamespaceAware(boolean namespaceAware) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getType() */ + @Override public int getType() { return XmlNode.XML_TYPE_ELEMENT; } @@ -517,6 +545,7 @@ public int getType() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isNillable() */ + @Override public boolean isNillable() { return false; } @@ -525,6 +554,7 @@ public boolean isNillable() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isRepeating() */ + @Override public boolean isRepeating() { return false; } @@ -533,6 +563,7 @@ public boolean isRepeating() { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#getProperty() */ + @Override public Property getProperty() { return getDelegate().getProperty(); } @@ -541,6 +572,7 @@ public Property getProperty() { * (non-Javadoc) * @see org.beanio.internal.parser.Parser#hasContent() */ + @Override public boolean hasContent(ParsingContext context) { return getDelegate().hasContent(context); } @@ -549,6 +581,7 @@ public boolean hasContent(ParsingContext context) { * (non-Javadoc) * @see org.beanio.internal.parser.Selector#isRecordGroup() */ + @Override public boolean isRecordGroup() { return false; } diff --git a/src/org/beanio/internal/parser/format/xml/XmlStreamFormat.java b/src/org/beanio/internal/parser/format/xml/XmlStreamFormat.java index 2f98d1f..e2c98af 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlStreamFormat.java +++ b/src/org/beanio/internal/parser/format/xml/XmlStreamFormat.java @@ -47,6 +47,7 @@ public XmlStreamFormat() { } * (non-Javadoc) * @see org.beanio.parser2.StreamFormat#createUnmarshallingContext() */ + @Override public UnmarshallingContext createUnmarshallingContext() { return new XmlUnmarshallingContext(groupDepth); } @@ -55,6 +56,7 @@ public UnmarshallingContext createUnmarshallingContext() { * (non-Javadoc) * @see org.beanio.parser2.StreamFormat#createMarshallingContext() */ + @Override public MarshallingContext createMarshallingContext(boolean streaming) { XmlMarshallingContext ctx = new XmlMarshallingContext(groupDepth); ctx.setStreaming(streaming); @@ -65,6 +67,7 @@ public MarshallingContext createMarshallingContext(boolean streaming) { public void setRecordParserFactory(RecordParserFactory recordParserFactory) { if (recordParserFactory != null && recordParserFactory instanceof XmlStreamConfigurationAware) { ((XmlStreamConfigurationAware)recordParserFactory).setConfiguration(new XmlStreamConfiguration() { + @Override public Document getDocument() { return createBaseDocument(layout); } diff --git a/src/org/beanio/internal/parser/format/xml/XmlTextField.java b/src/org/beanio/internal/parser/format/xml/XmlTextField.java index 2148383..320db7f 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlTextField.java +++ b/src/org/beanio/internal/parser/format/xml/XmlTextField.java @@ -60,6 +60,7 @@ public void insertText(XmlMarshallingContext ctx, String text) { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getType() */ + @Override public int getType() { return XmlNode.XML_TYPE_TEXT; } @@ -68,6 +69,7 @@ public int getType() { * (non-Javadoc) * @see org.beanio.internal.parser.FieldFormat#isNillable() */ + @Override public boolean isNillable() { return false; } @@ -76,6 +78,7 @@ public boolean isNillable() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getLocalName() */ + @Override public String getLocalName() { return null; } @@ -84,6 +87,7 @@ public String getLocalName() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getNamespace() */ + @Override public String getNamespace() { return null; } @@ -92,6 +96,7 @@ public String getNamespace() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#isNamespaceAware() */ + @Override public boolean isNamespaceAware() { return false; } @@ -100,10 +105,12 @@ public boolean isNamespaceAware() { * (non-Javadoc) * @see org.beanio.internal.parser.format.xml.XmlNode#getPrefix() */ + @Override public String getPrefix() { return null; } + @Override public boolean isRepeating() { return false; } diff --git a/src/org/beanio/internal/parser/format/xml/XmlWrapper.java b/src/org/beanio/internal/parser/format/xml/XmlWrapper.java index e3d904f..7c9cc83 100644 --- a/src/org/beanio/internal/parser/format/xml/XmlWrapper.java +++ b/src/org/beanio/internal/parser/format/xml/XmlWrapper.java @@ -134,6 +134,7 @@ public boolean marshal(MarshallingContext context) throws IOException { return true; } + @Override public String getLocalName() { return localName; } @@ -142,6 +143,7 @@ public void setLocalName(String localName) { this.localName = localName; } + @Override public String getPrefix() { return prefix; } @@ -150,6 +152,7 @@ public void setPrefix(String prefix) { this.prefix = prefix; } + @Override public String getNamespace() { return namespace; } @@ -158,6 +161,7 @@ public void setNamespace(String namespace) { this.namespace = namespace; } + @Override public boolean isNamespaceAware() { return namespaceAware; } @@ -166,6 +170,7 @@ public void setNamespaceAware(boolean namespaceAware) { this.namespaceAware = namespaceAware; } + @Override public boolean isNillable() { return nillable; } @@ -174,10 +179,12 @@ public void setNillable(boolean nillable) { this.nillable = nillable; } + @Override public int getType() { return XmlNode.XML_TYPE_ELEMENT; } + @Override public boolean isRepeating() { return repeating; } @@ -186,6 +193,7 @@ public void setRepeating(boolean repeating) { this.repeating = repeating; } + @Override public boolean isOptional() { return lazy; } diff --git a/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java b/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java index 1b00afd..86c76db 100644 --- a/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java +++ b/src/org/beanio/internal/parser/message/ResourceBundleMessageFactory.java @@ -47,6 +47,7 @@ public ResourceBundleMessageFactory() { } * (non-Javadoc) * @see org.beanio.parser.MessageContext#getRecordLabel(java.lang.String) */ + @Override public String getRecordLabel(String recordName) { return getLabel(LABEL_MESSAGE_PREFIX + "." + recordName); } @@ -55,6 +56,7 @@ public String getRecordLabel(String recordName) { * (non-Javadoc) * @see org.beanio.parser.MessageContext#getFieldLabel(java.lang.String, java.lang.String) */ + @Override public String getFieldLabel(String recordName, String fieldName) { return getLabel(LABEL_MESSAGE_PREFIX + "." + recordName + "." + fieldName); } @@ -87,6 +89,7 @@ protected String getLabel(String key) { * (non-Javadoc) * @see org.bio.context.MessageContext#getFieldErrorMessage(java.lang.String, java.lang.String, java.lang.String) */ + @Override public String getFieldErrorMessage(String recordName, String fieldName, String rule) { String key = FIELD_ERROR_MESSAGE_PREFIX + "." + recordName + "." + fieldName + "." + rule; @@ -126,6 +129,7 @@ public String getFieldErrorMessage(String recordName, String fieldName, String r * (non-Javadoc) * @see org.bio.context.MessageContext#getRecordErrorMessage(java.lang.String, java.lang.String) */ + @Override public String getRecordErrorMessage(String recordName, String rule) { String key = RECORD_ERROR_MESSAGE_PREFIX + "." + recordName + "." + rule; diff --git a/src/org/beanio/internal/util/BeanUtil.java b/src/org/beanio/internal/util/BeanUtil.java index 3786b33..7ec95e2 100644 --- a/src/org/beanio/internal/util/BeanUtil.java +++ b/src/org/beanio/internal/util/BeanUtil.java @@ -177,6 +177,7 @@ private static class EscapedCharacterTypeHandler implements TypeHandler { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public Character parse(String text) throws TypeConversionException { if (text == null) { return null; @@ -211,6 +212,7 @@ else if (NULL_ESCAPING_ENABLED && "\\0".equals(text)) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { throw new UnsupportedOperationException(); } @@ -219,6 +221,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Character.class; } @@ -234,6 +237,7 @@ private static class EscapedStringTypeHandler implements TypeHandler { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public String parse(String text) throws TypeConversionException { if (text == null) { return text; @@ -295,6 +299,7 @@ else if (c == '\\') { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { throw new UnsupportedOperationException(); } @@ -303,6 +308,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return String.class; } @@ -318,6 +324,7 @@ private static class StringArrayTypeHandler implements TypeHandler { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public String[] parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; @@ -360,6 +367,7 @@ else if (c == ',') { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { throw new UnsupportedOperationException(); } @@ -368,6 +376,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return String[].class; } diff --git a/src/org/beanio/internal/util/EnumTypeHandler.java b/src/org/beanio/internal/util/EnumTypeHandler.java index bb56cc9..af4f545 100644 --- a/src/org/beanio/internal/util/EnumTypeHandler.java +++ b/src/org/beanio/internal/util/EnumTypeHandler.java @@ -26,6 +26,7 @@ public EnumTypeHandler(Class type) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public Object parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; @@ -43,6 +44,7 @@ public Object parse(String text) throws TypeConversionException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { if (value == null) { return null; @@ -54,6 +56,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return type; } diff --git a/src/org/beanio/internal/util/StringUtil.java b/src/org/beanio/internal/util/StringUtil.java index 34339fc..7dddf8a 100644 --- a/src/org/beanio/internal/util/StringUtil.java +++ b/src/org/beanio/internal/util/StringUtil.java @@ -58,6 +58,7 @@ public static String doPropertySubstitution(String text, final Properties proper throws IllegalArgumentException { return doPropertySubstitution(text, new PropertySource() { + @Override public String getProperty(String key) { return properties != null ? properties.getProperty(key) : null; } diff --git a/src/org/beanio/internal/util/ToStringEnumTypeHandler.java b/src/org/beanio/internal/util/ToStringEnumTypeHandler.java index 5b953ee..4613b5a 100644 --- a/src/org/beanio/internal/util/ToStringEnumTypeHandler.java +++ b/src/org/beanio/internal/util/ToStringEnumTypeHandler.java @@ -36,6 +36,7 @@ public ToStringEnumTypeHandler(Class type) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public Object parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; @@ -53,6 +54,7 @@ public Object parse(String text) throws TypeConversionException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { if (value == null) { return null; @@ -64,6 +66,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return type; } diff --git a/src/org/beanio/internal/util/TreeNode.java b/src/org/beanio/internal/util/TreeNode.java index 10759c2..e21b4ff 100644 --- a/src/org/beanio/internal/util/TreeNode.java +++ b/src/org/beanio/internal/util/TreeNode.java @@ -137,6 +137,7 @@ public List getChildren() { * (non-Javadoc) * @see java.lang.Iterable#iterator() */ + @Override public Iterator iterator() { //assert children != null; return getChildren().iterator(); @@ -207,6 +208,7 @@ public void sort(Comparator comparator) { * @see java.lang.Object#clone() */ @SuppressWarnings("unchecked") + @Override public T clone() { try { return (T) super.clone(); @@ -221,6 +223,7 @@ public T clone() { * @see org.beanio.parser2.util.Replicateable#updateReferences(java.util.Map) */ @SuppressWarnings("unchecked") + @Override public void updateReferences(Map map) { if (children == null) { return; diff --git a/src/org/beanio/internal/util/TypeHandlerFactory.java b/src/org/beanio/internal/util/TypeHandlerFactory.java index 9baa3fe..7cb7d61 100644 --- a/src/org/beanio/internal/util/TypeHandlerFactory.java +++ b/src/org/beanio/internal/util/TypeHandlerFactory.java @@ -83,12 +83,14 @@ public class TypeHandlerFactory { settings.getProperty(Settings.DEFAULT_DATETIME_FORMAT))); defaultFactory.registerHandlerFor(TypeUtil.DATE_ALIAS, new DateTypeHandler( settings.getProperty(Settings.DEFAULT_DATE_FORMAT)) { + @Override protected DateFormat createDefaultDateFormat() { return DateFormat.getDateInstance(DateFormat.DEFAULT, locale); } }); defaultFactory.registerHandlerFor(TypeUtil.TIME_ALIAS, new DateTypeHandler( settings.getProperty(Settings.DEFAULT_TIME_FORMAT)) { + @Override protected DateFormat createDefaultDateFormat() { return DateFormat.getTimeInstance(DateFormat.DEFAULT, locale); } @@ -98,12 +100,14 @@ protected DateFormat createDefaultDateFormat() { settings.getProperty(Settings.DEFAULT_DATETIME_FORMAT))); defaultFactory.registerHandlerFor(TypeUtil.CALENDAR_DATE_ALIAS, new CalendarTypeHandler( settings.getProperty(Settings.DEFAULT_DATE_FORMAT)) { + @Override protected DateFormat createDefaultDateFormat() { return DateFormat.getDateInstance(DateFormat.DEFAULT, locale); } }); defaultFactory.registerHandlerFor(TypeUtil.CALENDAR_TIME_ALIAS, new CalendarTypeHandler( settings.getProperty(Settings.DEFAULT_TIME_FORMAT)) { + @Override protected DateFormat createDefaultDateFormat() { return DateFormat.getTimeInstance(DateFormat.DEFAULT, locale); } diff --git a/src/org/beanio/stream/RecordParserFactorySupport.java b/src/org/beanio/stream/RecordParserFactorySupport.java index 6759e38..e3d5bd3 100644 --- a/src/org/beanio/stream/RecordParserFactorySupport.java +++ b/src/org/beanio/stream/RecordParserFactorySupport.java @@ -26,20 +26,25 @@ */ public class RecordParserFactorySupport implements RecordParserFactory { + @Override public void init() throws IllegalArgumentException { } + @Override public RecordReader createReader(Reader in) throws IllegalArgumentException { throw new UnsupportedOperationException("BeanReader not supported"); } + @Override public RecordWriter createWriter(Writer out) throws IllegalArgumentException { throw new UnsupportedOperationException("BeanWriter not supported"); } + @Override public RecordMarshaller createMarshaller() throws IllegalArgumentException { throw new UnsupportedOperationException("Marshaller not supported"); } + @Override public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { throw new UnsupportedOperationException("Unmarshaller not supported"); } diff --git a/src/org/beanio/stream/csv/CsvReader.java b/src/org/beanio/stream/csv/CsvReader.java index a059358..858238c 100644 --- a/src/org/beanio/stream/csv/CsvReader.java +++ b/src/org/beanio/stream/csv/CsvReader.java @@ -121,6 +121,7 @@ public CsvReader(Reader in, CsvParserConfiguration config) throws IllegalArgumen * -1 is returned if the end of the stream was reached. * @return the starting line number of the last record */ + @Override public int getRecordLineNumber() { return recordLineNumber; } @@ -130,6 +131,7 @@ public int getRecordLineNumber() { * stream was reached. * @return the raw text of the last record */ + @Override public String getRecordText() { return recordText; } @@ -140,6 +142,7 @@ public String getRecordText() { * read from the stream * @throws IOException if an I/O error occurs */ + @Override public String[] read() throws IOException, RecordIOException { // fieldList is set to null when the end of stream is reached if (fieldList == null) { @@ -430,6 +433,7 @@ else if (c == '\r') { * (non-Javadoc) * @see org.beanio.stream.RecordReader#close() */ + @Override public void close() throws IOException { in.close(); } diff --git a/src/org/beanio/stream/csv/CsvRecordParser.java b/src/org/beanio/stream/csv/CsvRecordParser.java index fc7f7f3..60d47e8 100644 --- a/src/org/beanio/stream/csv/CsvRecordParser.java +++ b/src/org/beanio/stream/csv/CsvRecordParser.java @@ -87,6 +87,7 @@ public CsvRecordParser(CsvParserConfiguration config) { * (non-Javadoc) * @see org.beanio.stream.RecordParser#parse(java.lang.String) */ + @Override public Object unmarshal(String text) throws RecordIOException { fieldList.clear(); @@ -222,6 +223,7 @@ record = fieldList.toArray(record); * (non-Javadoc) * @see org.beanio.stream.RecordMarshaller#marshal(java.lang.Object) */ + @Override public String marshal(Object record) { return marshal((String[])record); } diff --git a/src/org/beanio/stream/csv/CsvRecordParserFactory.java b/src/org/beanio/stream/csv/CsvRecordParserFactory.java index 474e8cb..8561592 100644 --- a/src/org/beanio/stream/csv/CsvRecordParserFactory.java +++ b/src/org/beanio/stream/csv/CsvRecordParserFactory.java @@ -36,6 +36,7 @@ public CsvRecordParserFactory() { } * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#init() */ + @Override public void init() throws IllegalArgumentException { if (getQuote() == getDelimiter()) { @@ -53,6 +54,7 @@ public void init() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordReaderFactory#createReader(java.io.Reader) */ + @Override public RecordReader createReader(Reader in) throws IllegalArgumentException { return new CsvReader(in, this); } @@ -61,6 +63,7 @@ public RecordReader createReader(Reader in) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordWriterFactory#createWriter(java.io.Writer) */ + @Override public RecordWriter createWriter(Writer out) throws IllegalArgumentException { return new CsvWriter(out, this); } @@ -69,6 +72,7 @@ public RecordWriter createWriter(Writer out) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createMarshaller() */ + @Override public RecordMarshaller createMarshaller() throws IllegalArgumentException { return new CsvRecordParser(this); } @@ -77,6 +81,7 @@ public RecordMarshaller createMarshaller() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createUnmarshaller() */ + @Override public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { return new CsvRecordParser(this); } diff --git a/src/org/beanio/stream/csv/CsvWriter.java b/src/org/beanio/stream/csv/CsvWriter.java index d6e87e6..f835fb8 100644 --- a/src/org/beanio/stream/csv/CsvWriter.java +++ b/src/org/beanio/stream/csv/CsvWriter.java @@ -94,6 +94,7 @@ public int getLineNumber() { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#write(java.lang.Object) */ + @Override public void write(Object value) throws IOException { write((String[])value); } @@ -172,6 +173,7 @@ private boolean mustQuote(char [] cs) { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#flush() */ + @Override public void flush() throws IOException { out.flush(); } @@ -180,6 +182,7 @@ public void flush() throws IOException { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#close() */ + @Override public void close() throws IOException { out.close(); } diff --git a/src/org/beanio/stream/delimited/DelimitedReader.java b/src/org/beanio/stream/delimited/DelimitedReader.java index 2d7bb7a..52941cc 100644 --- a/src/org/beanio/stream/delimited/DelimitedReader.java +++ b/src/org/beanio/stream/delimited/DelimitedReader.java @@ -156,6 +156,7 @@ else if (s.length() > 1) { * not terminated by new line characters. * @return the starting line number of the last record */ + @Override public int getRecordLineNumber() { if (recordLineNumber < 0) return -1; @@ -168,6 +169,7 @@ public int getRecordLineNumber() { * stream was reached. * @return the raw text of the last record */ + @Override public String getRecordText() { return recordText; } @@ -176,6 +178,7 @@ public String getRecordText() { * (non-Javadoc) * @see org.beanio.stream.RecordReader#read() */ + @Override public String[] read() throws IOException { // fieldList is set to null when the end of stream is reached if (fieldList == null) { @@ -355,6 +358,7 @@ else if (c == '\n') { * (non-Javadoc) * @see org.beanio.stream.RecordReader#close() */ + @Override public void close() throws IOException { in.close(); } diff --git a/src/org/beanio/stream/delimited/DelimitedRecordParser.java b/src/org/beanio/stream/delimited/DelimitedRecordParser.java index 62c59fa..7c4da1a 100644 --- a/src/org/beanio/stream/delimited/DelimitedRecordParser.java +++ b/src/org/beanio/stream/delimited/DelimitedRecordParser.java @@ -65,6 +65,7 @@ public DelimitedRecordParser(DelimitedParserConfiguration config) { * (non-Javadoc) * @see org.beanio.stream.RecordParser#parse(java.lang.String) */ + @Override public String[] unmarshal(String text) { fieldList.clear(); @@ -110,6 +111,7 @@ else if (c == delim) { * (non-Javadoc) * @see org.beanio.stream.RecordMarshaller#marshal(java.lang.Object) */ + @Override public String marshal(Object record) { return marshal((String[]) record); } diff --git a/src/org/beanio/stream/delimited/DelimitedRecordParserFactory.java b/src/org/beanio/stream/delimited/DelimitedRecordParserFactory.java index dc6fe7c..1807447 100644 --- a/src/org/beanio/stream/delimited/DelimitedRecordParserFactory.java +++ b/src/org/beanio/stream/delimited/DelimitedRecordParserFactory.java @@ -36,6 +36,7 @@ public DelimitedRecordParserFactory() { } * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#init() */ + @Override public void init() throws IllegalArgumentException { if (getEscape() != null && getEscape() == getDelimiter()) { @@ -52,6 +53,7 @@ public void init() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordReaderFactory#createReader(java.io.Reader) */ + @Override public RecordReader createReader(Reader in) throws IllegalArgumentException { return new DelimitedReader(in, this); } @@ -60,6 +62,7 @@ public RecordReader createReader(Reader in) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordWriterFactory#createWriter(java.io.Writer) */ + @Override public RecordWriter createWriter(Writer out) throws IllegalArgumentException { return new DelimitedWriter(out, this); } @@ -68,6 +71,7 @@ public RecordWriter createWriter(Writer out) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createMarshaller() */ + @Override public RecordMarshaller createMarshaller() throws IllegalArgumentException { return new DelimitedRecordParser(this); } @@ -76,6 +80,7 @@ public RecordMarshaller createMarshaller() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createUnmarshaller() */ + @Override public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { return new DelimitedRecordParser(this); } diff --git a/src/org/beanio/stream/delimited/DelimitedWriter.java b/src/org/beanio/stream/delimited/DelimitedWriter.java index 8c79050..0cfa80a 100644 --- a/src/org/beanio/stream/delimited/DelimitedWriter.java +++ b/src/org/beanio/stream/delimited/DelimitedWriter.java @@ -99,6 +99,7 @@ public DelimitedWriter(Writer out, DelimitedParserConfiguration config) { * (non-Javadoc) * @see org.beanio.line.RecordWriter#write(java.lang.Object) */ + @Override public void write(Object value) throws IOException, RecordIOException { write((String[]) value); } @@ -141,6 +142,7 @@ public void write(String[] record) throws IOException { * (non-Javadoc) * @see org.beanio.line.RecordWriter#flush() */ + @Override public void flush() throws IOException { out.flush(); } @@ -149,6 +151,7 @@ public void flush() throws IOException { * (non-Javadoc) * @see org.beanio.line.RecordWriter#close() */ + @Override public void close() throws IOException { out.close(); } diff --git a/src/org/beanio/stream/fixedlength/FixedLengthReader.java b/src/org/beanio/stream/fixedlength/FixedLengthReader.java index 818f8b0..4c2ca89 100644 --- a/src/org/beanio/stream/fixedlength/FixedLengthReader.java +++ b/src/org/beanio/stream/fixedlength/FixedLengthReader.java @@ -106,6 +106,7 @@ else if (s.length() > 1) { * (non-Javadoc) * @see org.beanio.line.RecordReader#getRecordLineNumber() */ + @Override public int getRecordLineNumber() { if (recordLineNumber < 0) { return recordLineNumber; @@ -117,6 +118,7 @@ public int getRecordLineNumber() { * (non-Javadoc) * @see org.beanio.line.RecordReader#getRecordText() */ + @Override public String getRecordText() { return recordText; } @@ -125,6 +127,7 @@ public String getRecordText() { * (non-Javadoc) * @see org.beanio.line.RecordReader#read() */ + @Override public String read() throws IOException, RecordIOException { if (eof) { recordText = null; @@ -252,6 +255,7 @@ else if (c == '\n') { * (non-Javadoc) * @see org.beanio.line.RecordReader#close() */ + @Override public void close() throws IOException { in.close(); } diff --git a/src/org/beanio/stream/fixedlength/FixedLengthRecordParser.java b/src/org/beanio/stream/fixedlength/FixedLengthRecordParser.java index 2252bd3..8920daa 100644 --- a/src/org/beanio/stream/fixedlength/FixedLengthRecordParser.java +++ b/src/org/beanio/stream/fixedlength/FixedLengthRecordParser.java @@ -35,6 +35,7 @@ public FixedLengthRecordParser() { } * (non-Javadoc) * @see org.beanio.stream.RecordUnmarshaller#unmarshal(java.lang.String) */ + @Override public Object unmarshal(String text) { return text; } @@ -43,6 +44,7 @@ public Object unmarshal(String text) { * (non-Javadoc) * @see org.beanio.stream.RecordMarshaller#marshal(java.lang.Object) */ + @Override public String marshal(Object record) { return marshal((String)record); } diff --git a/src/org/beanio/stream/fixedlength/FixedLengthRecordParserFactory.java b/src/org/beanio/stream/fixedlength/FixedLengthRecordParserFactory.java index 249742e..a703ba1 100644 --- a/src/org/beanio/stream/fixedlength/FixedLengthRecordParserFactory.java +++ b/src/org/beanio/stream/fixedlength/FixedLengthRecordParserFactory.java @@ -39,6 +39,7 @@ public FixedLengthRecordParserFactory() { } * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#init() */ + @Override public void init() throws BeanIOConfigurationException { } @@ -47,6 +48,7 @@ public void init() throws BeanIOConfigurationException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createReader(java.io.Reader) */ + @Override public RecordReader createReader(Reader in) throws IllegalArgumentException { return new FixedLengthReader(in, this); } @@ -55,6 +57,7 @@ public RecordReader createReader(Reader in) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createWriter(java.io.Writer) */ + @Override public RecordWriter createWriter(Writer out) throws IllegalArgumentException { return new FixedLengthWriter(out, getRecordTerminator()); } @@ -63,6 +66,7 @@ public RecordWriter createWriter(Writer out) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createMarshaller() */ + @Override public RecordMarshaller createMarshaller() throws IllegalArgumentException { return parser; } @@ -71,6 +75,7 @@ public RecordMarshaller createMarshaller() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createUnmarshaller() */ + @Override public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { return parser; } diff --git a/src/org/beanio/stream/fixedlength/FixedLengthWriter.java b/src/org/beanio/stream/fixedlength/FixedLengthWriter.java index c226842..24ed45c 100644 --- a/src/org/beanio/stream/fixedlength/FixedLengthWriter.java +++ b/src/org/beanio/stream/fixedlength/FixedLengthWriter.java @@ -57,6 +57,7 @@ public FixedLengthWriter(Writer out, String recordTerminator) { * (non-Javadoc) * @see org.beanio.line.RecordWriter#write(java.lang.Object) */ + @Override public void write(Object value) throws IOException, RecordIOException { out.write(value.toString()); out.write(recordTerminator); @@ -66,6 +67,7 @@ public void write(Object value) throws IOException, RecordIOException { * (non-Javadoc) * @see org.beanio.line.RecordWriter#flush() */ + @Override public void flush() throws IOException { out.flush(); } @@ -74,6 +76,7 @@ public void flush() throws IOException { * (non-Javadoc) * @see org.beanio.line.RecordWriter#close() */ + @Override public void close() throws IOException { out.close(); } diff --git a/src/org/beanio/stream/json/JsonReader.java b/src/org/beanio/stream/json/JsonReader.java index 5678850..c33708b 100644 --- a/src/org/beanio/stream/json/JsonReader.java +++ b/src/org/beanio/stream/json/JsonReader.java @@ -49,6 +49,7 @@ public JsonReader(Reader in) { * (non-Javadoc) * @see org.beanio.stream.RecordReader#read() */ + @Override public Map read() throws IOException, RecordIOException { if (eof) { return null; @@ -83,6 +84,7 @@ else if (!isWhitespace(c)) { * (non-Javadoc) * @see org.beanio.stream.RecordReader#close() */ + @Override public void close() throws IOException { if (in != null) { try { @@ -98,6 +100,7 @@ public void close() throws IOException { * (non-Javadoc) * @see org.beanio.stream.RecordReader#getRecordLineNumber() */ + @Override public int getRecordLineNumber() { return recordLineNumber; } @@ -106,6 +109,7 @@ public int getRecordLineNumber() { * (non-Javadoc) * @see org.beanio.stream.RecordReader#getRecordText() */ + @Override public String getRecordText() { return recordText; } diff --git a/src/org/beanio/stream/json/JsonRecordMarshaller.java b/src/org/beanio/stream/json/JsonRecordMarshaller.java index 89a03fe..c09d010 100644 --- a/src/org/beanio/stream/json/JsonRecordMarshaller.java +++ b/src/org/beanio/stream/json/JsonRecordMarshaller.java @@ -51,6 +51,7 @@ public JsonRecordMarshaller(JsonParserConfiguration config) { * @see org.beanio.stream.RecordMarshaller#marshal(java.lang.Object) */ @SuppressWarnings("unchecked") + @Override public String marshal(Object record) { return marshal((Map) record); } diff --git a/src/org/beanio/stream/json/JsonRecordParserFactory.java b/src/org/beanio/stream/json/JsonRecordParserFactory.java index 9c01e1a..8b8d566 100644 --- a/src/org/beanio/stream/json/JsonRecordParserFactory.java +++ b/src/org/beanio/stream/json/JsonRecordParserFactory.java @@ -41,12 +41,14 @@ public JsonRecordParserFactory() { } * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#init() */ + @Override public void init() throws IllegalArgumentException { } /* * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createReader(java.io.Reader) */ + @Override public RecordReader createReader(Reader in) throws IllegalArgumentException { return new JsonReader(in); } @@ -55,6 +57,7 @@ public RecordReader createReader(Reader in) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createWriter(java.io.Writer) */ + @Override public RecordWriter createWriter(Writer out) throws IllegalArgumentException { return new JsonWriter(out, this); } @@ -63,6 +66,7 @@ public RecordWriter createWriter(Writer out) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createMarshaller() */ + @Override public RecordMarshaller createMarshaller() throws IllegalArgumentException { return new JsonRecordMarshaller(this); } @@ -71,6 +75,7 @@ public RecordMarshaller createMarshaller() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createUnmarshaller() */ + @Override public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { return new JsonRecordUnmarshaller(); } diff --git a/src/org/beanio/stream/json/JsonRecordUnmarshaller.java b/src/org/beanio/stream/json/JsonRecordUnmarshaller.java index bb87fbc..5e5c033 100644 --- a/src/org/beanio/stream/json/JsonRecordUnmarshaller.java +++ b/src/org/beanio/stream/json/JsonRecordUnmarshaller.java @@ -42,6 +42,7 @@ public JsonRecordUnmarshaller() { * (non-Javadoc) * @see org.beanio.stream.RecordUnmarshaller#unmarshal(java.lang.String) */ + @Override public Map unmarshal(String text) throws RecordIOException { if (text == null) { return null; diff --git a/src/org/beanio/stream/json/JsonWriter.java b/src/org/beanio/stream/json/JsonWriter.java index c5be7c2..59f0f23 100644 --- a/src/org/beanio/stream/json/JsonWriter.java +++ b/src/org/beanio/stream/json/JsonWriter.java @@ -54,6 +54,7 @@ public JsonWriter(Writer out, JsonParserConfiguration config) { * @see org.beanio.stream.RecordWriter#write(java.lang.Object) */ @SuppressWarnings("unchecked") + @Override public void write(Object record) throws IOException { write((Map)record); out.write(getLineSeparator()); @@ -63,6 +64,7 @@ public void write(Object record) throws IOException { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#flush() */ + @Override public void flush() throws IOException { out.flush(); } @@ -71,6 +73,7 @@ public void flush() throws IOException { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#close() */ + @Override public void close() throws IOException { out.close(); } diff --git a/src/org/beanio/stream/xml/XmlReader.java b/src/org/beanio/stream/xml/XmlReader.java index 36e00c1..324fb57 100644 --- a/src/org/beanio/stream/xml/XmlReader.java +++ b/src/org/beanio/stream/xml/XmlReader.java @@ -132,6 +132,7 @@ public XmlReader(Reader reader, Document base) { * (non-Javadoc) * @see org.beanio.stream.RecordReader#read() */ + @Override public Document read() throws IOException, RecordIOException { if (eof) { return null; @@ -302,6 +303,7 @@ private boolean isNode(Node node, String namespace, String name) { * (non-Javadoc) * @see org.beanio.stream.RecordReader#close() */ + @Override public void close() throws IOException { try { in.close(); @@ -317,6 +319,7 @@ public void close() throws IOException { * (non-Javadoc) * @see org.beanio.stream.RecordReader#getRecordLineNumber() */ + @Override public int getRecordLineNumber() { return recordLineNumber; } @@ -325,6 +328,7 @@ public int getRecordLineNumber() { * (non-Javadoc) * @see org.beanio.stream.RecordReader#getRecordText() */ + @Override public String getRecordText() { return null; } diff --git a/src/org/beanio/stream/xml/XmlRecordMarshaller.java b/src/org/beanio/stream/xml/XmlRecordMarshaller.java index 78b7b4f..34cadfd 100644 --- a/src/org/beanio/stream/xml/XmlRecordMarshaller.java +++ b/src/org/beanio/stream/xml/XmlRecordMarshaller.java @@ -99,6 +99,7 @@ private void init() { * (non-Javadoc) * @see org.beanio.stream.RecordMarshaller#marshal(java.lang.Object) */ + @Override public String marshal(Object record) throws RecordIOException { try { return marshal((Document)record); diff --git a/src/org/beanio/stream/xml/XmlRecordParserFactory.java b/src/org/beanio/stream/xml/XmlRecordParserFactory.java index 24406af..f564858 100644 --- a/src/org/beanio/stream/xml/XmlRecordParserFactory.java +++ b/src/org/beanio/stream/xml/XmlRecordParserFactory.java @@ -40,6 +40,7 @@ public XmlRecordParserFactory() { } * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#init() */ + @Override public void init() throws IllegalArgumentException { } @@ -48,6 +49,7 @@ public void init() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordReaderFactory#createReader(java.io.Reader) */ + @Override public RecordReader createReader(Reader in) throws IllegalArgumentException { Document base = null; if (source != null) { @@ -61,6 +63,7 @@ public RecordReader createReader(Reader in) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordWriterFactory#createWriter(java.io.Writer) */ + @Override public RecordWriter createWriter(Writer out) throws IllegalArgumentException { return new XmlWriter(out, this); } @@ -69,6 +72,7 @@ public RecordWriter createWriter(Writer out) throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createMarshaller() */ + @Override public RecordMarshaller createMarshaller() throws IllegalArgumentException { return new XmlRecordMarshaller(this); } @@ -77,6 +81,7 @@ public RecordMarshaller createMarshaller() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.RecordParserFactory#createUnmarshaller() */ + @Override public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { return new XmlRecordUnmarshaller(); } @@ -85,6 +90,7 @@ public RecordUnmarshaller createUnmarshaller() throws IllegalArgumentException { * (non-Javadoc) * @see org.beanio.stream.xml.XmlDocumentAware#setSource(org.beanio.stream.xml.XmlDocumentSource) */ + @Override public void setConfiguration(XmlStreamConfiguration source) { this.source = source; } diff --git a/src/org/beanio/stream/xml/XmlRecordUnmarshaller.java b/src/org/beanio/stream/xml/XmlRecordUnmarshaller.java index 64e0b8e..0f2ebac 100644 --- a/src/org/beanio/stream/xml/XmlRecordUnmarshaller.java +++ b/src/org/beanio/stream/xml/XmlRecordUnmarshaller.java @@ -55,6 +55,7 @@ public XmlRecordUnmarshaller() { } * (non-Javadoc) * @see org.beanio.stream.RecordUnmarshaller#unmarshal(java.lang.String) */ + @Override public Object unmarshal(String text) throws RecordIOException { try { return documentBuilder.parse(new InputSource(new StringReader(text))); diff --git a/src/org/beanio/stream/xml/XmlWriter.java b/src/org/beanio/stream/xml/XmlWriter.java index 519217d..61b182c 100644 --- a/src/org/beanio/stream/xml/XmlWriter.java +++ b/src/org/beanio/stream/xml/XmlWriter.java @@ -182,6 +182,7 @@ private void init() { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#write(java.lang.Object) */ + @Override public void write(Object record) throws IOException { try { // write the XMl header if needed @@ -430,6 +431,7 @@ else if (attPrefix == null) { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#flush() */ + @Override public void flush() throws IOException { try { out.flush(); @@ -443,6 +445,7 @@ public void flush() throws IOException { * (non-Javadoc) * @see org.beanio.stream.RecordWriter#close() */ + @Override public void close() throws IOException { try { while (elementStack != null) { @@ -524,6 +527,7 @@ private ElementStack pop() { * (non-Javadoc) * @see org.beanio.util.StatefulWriter#updateState(java.lang.String, java.util.Map) */ + @Override public void updateState(String namespace, Map state) { state.put(getKey(namespace, OUTPUT_HEADER_KEY), outputHeader); state.put(getKey(namespace, NAMESPACE_MAP_KEY), toToken(namespaceMap)); @@ -567,6 +571,7 @@ public void updateState(String namespace, Map state) { * (non-Javadoc) * @see org.beanio.util.StatefulWriter#restoreState(java.lang.String, java.util.Map) */ + @Override public void restoreState(String namespace, Map state) throws IllegalStateException { this.outputHeader = (Boolean) getRequired(namespace, OUTPUT_HEADER_KEY, state); diff --git a/src/org/beanio/types/BigDecimalTypeHandler.java b/src/org/beanio/types/BigDecimalTypeHandler.java index bbce16f..d7342c7 100644 --- a/src/org/beanio/types/BigDecimalTypeHandler.java +++ b/src/org/beanio/types/BigDecimalTypeHandler.java @@ -43,6 +43,7 @@ protected BigDecimal createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return BigDecimal.class; } diff --git a/src/org/beanio/types/BigIntegerTypeHandler.java b/src/org/beanio/types/BigIntegerTypeHandler.java index e368922..db23e0c 100644 --- a/src/org/beanio/types/BigIntegerTypeHandler.java +++ b/src/org/beanio/types/BigIntegerTypeHandler.java @@ -43,6 +43,7 @@ protected BigInteger createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return BigInteger.class; } diff --git a/src/org/beanio/types/BooleanTypeHandler.java b/src/org/beanio/types/BooleanTypeHandler.java index 3b6c55c..a013407 100644 --- a/src/org/beanio/types/BooleanTypeHandler.java +++ b/src/org/beanio/types/BooleanTypeHandler.java @@ -29,6 +29,7 @@ public class BooleanTypeHandler implements TypeHandler { * @param text the text to parse * @return new Boolean */ + @Override public Boolean parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) return null; @@ -40,6 +41,7 @@ public Boolean parse(String text) throws TypeConversionException { * Returns {@link Boolean#toString()}, or null if value * is null. */ + @Override public String format(Object value) { if (value == null) return null; @@ -50,6 +52,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Boolean.class; } diff --git a/src/org/beanio/types/ByteTypeHandler.java b/src/org/beanio/types/ByteTypeHandler.java index ec52806..d5e3d5f 100644 --- a/src/org/beanio/types/ByteTypeHandler.java +++ b/src/org/beanio/types/ByteTypeHandler.java @@ -43,6 +43,7 @@ protected Byte createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Byte.class; } diff --git a/src/org/beanio/types/CalendarTypeHandler.java b/src/org/beanio/types/CalendarTypeHandler.java index a78834d..b042d4c 100644 --- a/src/org/beanio/types/CalendarTypeHandler.java +++ b/src/org/beanio/types/CalendarTypeHandler.java @@ -50,6 +50,7 @@ public CalendarTypeHandler(String pattern) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public Calendar parse(String text) throws TypeConversionException { Date date = parseDate(text); if (date == null) { @@ -64,6 +65,7 @@ public Calendar parse(String text) throws TypeConversionException { * (non-Javadoc) * @see org.beanio.types.AbstractDateTypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { return formatCalendar((Calendar)value); } @@ -76,6 +78,7 @@ protected String formatCalendar(Calendar calendar) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Calendar.class; } diff --git a/src/org/beanio/types/CharacterTypeHandler.java b/src/org/beanio/types/CharacterTypeHandler.java index f18cd98..8200267 100644 --- a/src/org/beanio/types/CharacterTypeHandler.java +++ b/src/org/beanio/types/CharacterTypeHandler.java @@ -28,6 +28,7 @@ public class CharacterTypeHandler implements TypeHandler { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public Character parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) return null; @@ -43,6 +44,7 @@ public Character parse(String text) throws TypeConversionException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { if (value == null) return null; @@ -53,6 +55,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Character.class; } diff --git a/src/org/beanio/types/DateTypeHandler.java b/src/org/beanio/types/DateTypeHandler.java index dbef8fc..ab7613d 100644 --- a/src/org/beanio/types/DateTypeHandler.java +++ b/src/org/beanio/types/DateTypeHandler.java @@ -48,6 +48,7 @@ public DateTypeHandler(String pattern) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#parse(java.lang.String) */ + @Override public Date parse(String text) throws TypeConversionException { return super.parseDate(text); } @@ -56,6 +57,7 @@ public Date parse(String text) throws TypeConversionException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#format(java.lang.Object) */ + @Override public String format(Object value) { return super.formatDate((Date)value); } @@ -64,6 +66,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Date.class; } diff --git a/src/org/beanio/types/DateTypeHandlerSupport.java b/src/org/beanio/types/DateTypeHandlerSupport.java index b3eb004..ff0d371 100644 --- a/src/org/beanio/types/DateTypeHandlerSupport.java +++ b/src/org/beanio/types/DateTypeHandlerSupport.java @@ -114,6 +114,7 @@ protected DateFormat createDefaultDateFormat() { * (non-Javadoc) * @see org.beanio.types.AbstractDateTypeHandler#newInstance(java.util.Properties) */ + @Override public DateTypeHandlerSupport newInstance(Properties properties) throws IllegalArgumentException { String pattern = properties.getProperty(FORMAT_SETTING); if (pattern == null || "".equals(pattern)) { diff --git a/src/org/beanio/types/DoubleTypeHandler.java b/src/org/beanio/types/DoubleTypeHandler.java index 0f605fe..d63bb57 100644 --- a/src/org/beanio/types/DoubleTypeHandler.java +++ b/src/org/beanio/types/DoubleTypeHandler.java @@ -43,6 +43,7 @@ protected Double createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Double.class; } diff --git a/src/org/beanio/types/FloatTypeHandler.java b/src/org/beanio/types/FloatTypeHandler.java index 762fd3f..88bc97a 100644 --- a/src/org/beanio/types/FloatTypeHandler.java +++ b/src/org/beanio/types/FloatTypeHandler.java @@ -41,6 +41,7 @@ protected Float createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Float.class; } diff --git a/src/org/beanio/types/IntegerTypeHandler.java b/src/org/beanio/types/IntegerTypeHandler.java index c3bbb65..fcb938d 100644 --- a/src/org/beanio/types/IntegerTypeHandler.java +++ b/src/org/beanio/types/IntegerTypeHandler.java @@ -43,6 +43,7 @@ protected Integer createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Integer.class; } diff --git a/src/org/beanio/types/LongTypeHandler.java b/src/org/beanio/types/LongTypeHandler.java index 4106901..9c0d488 100644 --- a/src/org/beanio/types/LongTypeHandler.java +++ b/src/org/beanio/types/LongTypeHandler.java @@ -43,6 +43,7 @@ protected Long createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Long.class; } diff --git a/src/org/beanio/types/NumberTypeHandler.java b/src/org/beanio/types/NumberTypeHandler.java index 417b16c..897c3fe 100644 --- a/src/org/beanio/types/NumberTypeHandler.java +++ b/src/org/beanio/types/NumberTypeHandler.java @@ -45,6 +45,7 @@ public abstract class NumberTypeHandler extends LocaleSupport implements Configu * or an empty string * @throws TypeConversionException if the text is not a valid number */ + @Override public final Number parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; @@ -113,6 +114,7 @@ public final Number parse(String text) throws TypeConversionException { * (non-Javadoc) * @see org.beanio.types.ConfigurableTypeHandler#newInstance(java.util.Properties) */ + @Override public TypeHandler newInstance(Properties properties) throws IllegalArgumentException { String pattern = properties.getProperty(FORMAT_SETTING); if (pattern == null || "".equals(pattern)) { @@ -145,6 +147,7 @@ protected DecimalFormat createDecimalFormat() { * @param value the number to format * @return the formatted number */ + @Override public String format(Object value) { if (value == null) return null; diff --git a/src/org/beanio/types/ShortTypeHandler.java b/src/org/beanio/types/ShortTypeHandler.java index 7c69ae0..b3ce43c 100644 --- a/src/org/beanio/types/ShortTypeHandler.java +++ b/src/org/beanio/types/ShortTypeHandler.java @@ -43,6 +43,7 @@ protected Short createNumber(BigDecimal bg) throws ArithmeticException { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Short.class; } diff --git a/src/org/beanio/types/StringTypeHandler.java b/src/org/beanio/types/StringTypeHandler.java index 7bc5702..03f90cb 100644 --- a/src/org/beanio/types/StringTypeHandler.java +++ b/src/org/beanio/types/StringTypeHandler.java @@ -31,6 +31,7 @@ public class StringTypeHandler implements TypeHandler { * @param text the text to parse * @return the parsed String */ + @Override public String parse(String text) { if (text != null) { if (trim) { @@ -48,6 +49,7 @@ public String parse(String text) { * @param value the value to format * @return the formatted value, or null if value is null */ + @Override public String format(Object value) { if (value == null) return null; @@ -58,6 +60,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return String.class; } diff --git a/src/org/beanio/types/URLTypeHandler.java b/src/org/beanio/types/URLTypeHandler.java index 1189220..90181a8 100644 --- a/src/org/beanio/types/URLTypeHandler.java +++ b/src/org/beanio/types/URLTypeHandler.java @@ -31,6 +31,7 @@ public class URLTypeHandler implements TypeHandler { * @return the parsed {@link URL} or null if text * is null or an empty string */ + @Override public Object parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; @@ -51,6 +52,7 @@ public Object parse(String text) throws TypeConversionException { * @param value the {@link URL} to format * @return the formatted text */ + @Override public String format(Object value) { if (value == null) return null; @@ -61,6 +63,7 @@ public String format(Object value) { /** * Returns {@link URL}. */ + @Override public Class getType() { return URL.class; } diff --git a/src/org/beanio/types/UUIDTypeHandler.java b/src/org/beanio/types/UUIDTypeHandler.java index 8687554..746d181 100644 --- a/src/org/beanio/types/UUIDTypeHandler.java +++ b/src/org/beanio/types/UUIDTypeHandler.java @@ -31,6 +31,7 @@ public class UUIDTypeHandler implements TypeHandler { * @return the parsed {@link UUID} or null if text * is null or an empty string */ + @Override public Object parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; @@ -51,6 +52,7 @@ public Object parse(String text) throws TypeConversionException { * @param value the {@link UUID} to format * @return the formatted text */ + @Override public String format(Object value) { if (value == null) return null; @@ -61,6 +63,7 @@ public String format(Object value) { /** * Returns {@link UUID}. */ + @Override public Class getType() { return UUID.class; } diff --git a/src/org/beanio/types/xml/XmlBooleanTypeHandler.java b/src/org/beanio/types/xml/XmlBooleanTypeHandler.java index 5ace5db..d1e9f2d 100644 --- a/src/org/beanio/types/xml/XmlBooleanTypeHandler.java +++ b/src/org/beanio/types/xml/XmlBooleanTypeHandler.java @@ -39,6 +39,7 @@ public XmlBooleanTypeHandler() { } * @param text the text to parse * @return new Boolean */ + @Override public Boolean parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) return null; @@ -58,6 +59,7 @@ else if ("false".equals(text) || "0".equals(text)) { * Returns {@link Boolean#toString()}, or null if value * is null. */ + @Override public String format(Object value) { if (value == null) return null; @@ -75,6 +77,7 @@ public String format(Object value) { * (non-Javadoc) * @see org.beanio.types.TypeHandler#getType() */ + @Override public Class getType() { return Boolean.class; } diff --git a/test/org/beanio/beans/Order.java b/test/org/beanio/beans/Order.java index 665db21..8b58b55 100644 --- a/test/org/beanio/beans/Order.java +++ b/test/org/beanio/beans/Order.java @@ -69,6 +69,7 @@ public Map getItemMap() { public void setItemMap(Map itemMap) { this.itemMap = itemMap; } + @Override public String toString() { return id; } diff --git a/test/org/beanio/beans/OrderBatch.java b/test/org/beanio/beans/OrderBatch.java index 0ac543f..cbf9b1f 100644 --- a/test/org/beanio/beans/OrderBatch.java +++ b/test/org/beanio/beans/OrderBatch.java @@ -38,6 +38,7 @@ public void setOrderArray(Order[] orderArray) { orders = Arrays.asList(orderArray); } + @Override public String toString() { return "OrderBatch" + "[count=" + batchCount + diff --git a/test/org/beanio/beans/Person.java b/test/org/beanio/beans/Person.java index f8bf29e..034f612 100644 --- a/test/org/beanio/beans/Person.java +++ b/test/org/beanio/beans/Person.java @@ -42,6 +42,7 @@ public String getLastName() { public void setLastName(String lastName) { this.lastName = lastName; } + @Override public String toString() { return firstName + " " + lastName; } diff --git a/test/org/beanio/parser/annotation/AnnotatedUser.java b/test/org/beanio/parser/annotation/AnnotatedUser.java index 9f4c652..71b4393 100644 --- a/test/org/beanio/parser/annotation/AnnotatedUser.java +++ b/test/org/beanio/parser/annotation/AnnotatedUser.java @@ -32,6 +32,7 @@ public class AnnotatedUser extends AnnotatedUserSupport implements AnnotatedUser @Field(at=-1) public String end; + @Override public String[] getHands() { return hands; } diff --git a/test/org/beanio/parser/bean/Widget.java b/test/org/beanio/parser/bean/Widget.java index 3379f72..67b7e65 100644 --- a/test/org/beanio/parser/bean/Widget.java +++ b/test/org/beanio/parser/bean/Widget.java @@ -28,6 +28,7 @@ public class Widget { private List partsList; private Map partsMap; + @Override public String toString() { return "[id=" + id + diff --git a/test/org/beanio/parser/types/TypeEnum.java b/test/org/beanio/parser/types/TypeEnum.java index 72ca633..cd7d951 100644 --- a/test/org/beanio/parser/types/TypeEnum.java +++ b/test/org/beanio/parser/types/TypeEnum.java @@ -4,6 +4,7 @@ public enum TypeEnum { ONE, TWO; + @Override public String toString() { return super.toString().toLowerCase(); } diff --git a/test/org/beanio/parser/writemode/WriteModeParserTest.java b/test/org/beanio/parser/writemode/WriteModeParserTest.java index 9b6cbc0..e557a4c 100644 --- a/test/org/beanio/parser/writemode/WriteModeParserTest.java +++ b/test/org/beanio/parser/writemode/WriteModeParserTest.java @@ -45,15 +45,19 @@ public void setup() throws Exception { @Test public void testBasic() { PersonInterface person = new PersonInterface() { + @Override public String getFirstName() { return "John"; } + @Override public String getLastName() { return "Smith"; } + @Override public int getAge() { return 21; } + @Override public Date getBirthDate() { try { return new SimpleDateFormat("yyyy-MM-dd").parse("2011-01-01"); diff --git a/test/org/beanio/parser/xml/Address.java b/test/org/beanio/parser/xml/Address.java index eda5dc4..b0be8a0 100644 --- a/test/org/beanio/parser/xml/Address.java +++ b/test/org/beanio/parser/xml/Address.java @@ -45,6 +45,7 @@ public void setZip(String zip) { this.zip = zip; } + @Override public String toString() { return "[" + city + ", " + state + " " + zip + "]"; } diff --git a/test/org/beanio/parser/xml/Person.java b/test/org/beanio/parser/xml/Person.java index 943005f..7537560 100644 --- a/test/org/beanio/parser/xml/Person.java +++ b/test/org/beanio/parser/xml/Person.java @@ -89,6 +89,7 @@ public void setAge(Integer age) { this.age = age; } + @Override public String toString() { return gender + ": " + firstName + " " + lastName + ":" + color + " " + addressList; } diff --git a/test/org/beanio/util/IOUtilTest.java b/test/org/beanio/util/IOUtilTest.java index 8b1e98c..105d985 100644 --- a/test/org/beanio/util/IOUtilTest.java +++ b/test/org/beanio/util/IOUtilTest.java @@ -31,6 +31,7 @@ public class IOUtilTest { @Test public void testCloseReader() { Reader in = new FilterReader(new StringReader("value")) { + @Override public void close() throws IOException { throw new IOException(); } @@ -42,6 +43,7 @@ public void close() throws IOException { @Test public void testCloseWriter() { Writer out = new StringWriter() { + @Override public void close() throws IOException { throw new IOException(); } @@ -54,6 +56,7 @@ public void close() throws IOException { public void testCloseInputStream() { byte [] b = new byte[] { 1, 2, 3, 4 }; InputStream in = new ByteArrayInputStream(b) { + @Override public void close() throws IOException { throw new IOException(); } @@ -65,6 +68,7 @@ public void close() throws IOException { @Test public void testCloseOutputStream() { OutputStream out = new ByteArrayOutputStream() { + @Override public void close() throws IOException { throw new IOException(); } From e45fed5dcc5992e008b574adace8ff0f25490f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Garcia?= Date: Sun, 17 Jan 2016 05:14:18 -0200 Subject: [PATCH 4/4] Dropping unnecessary exceptions --- .../beanio/parser/bean/BeanParserTest.java | 2 +- .../parser/multiline/MultilineRecordTest.java | 12 +++++----- .../PropertySubstitutionParserTest.java | 4 ++-- .../beanio/stream/CsvRecordParserTest.java | 2 +- .../stream/DelimitedRecordParserTest.java | 22 +++++++++---------- test/org/beanio/stream/JsonReaderTest.java | 20 ++++++++--------- .../types/CharacterTypeHandlerTest.java | 2 +- .../types/XmlBooleanTypeHandlerTest.java | 4 ++-- 8 files changed, 34 insertions(+), 34 deletions(-) diff --git a/test/org/beanio/parser/bean/BeanParserTest.java b/test/org/beanio/parser/bean/BeanParserTest.java index a65fa09..0a7fcf1 100644 --- a/test/org/beanio/parser/bean/BeanParserTest.java +++ b/test/org/beanio/parser/bean/BeanParserTest.java @@ -286,7 +286,7 @@ public void testFixedLengthCollection() { @Test @SuppressWarnings("rawtypes") - public void testNestedBeans() throws IOException { + public void testNestedBeans() { BeanReader in = factory.createReader("w10", new InputStreamReader( getClass().getResourceAsStream("w10_nestedBeans.txt"))); diff --git a/test/org/beanio/parser/multiline/MultilineRecordTest.java b/test/org/beanio/parser/multiline/MultilineRecordTest.java index 3891563..8d01f6a 100644 --- a/test/org/beanio/parser/multiline/MultilineRecordTest.java +++ b/test/org/beanio/parser/multiline/MultilineRecordTest.java @@ -124,7 +124,7 @@ public void testRecordGroup() throws ParseException { } @Test - public void testNestedRecorGroup() throws ParseException { + public void testNestedRecorGroup() { BeanReader in = factory.createReader("ml2", new InputStreamReader( getClass().getResourceAsStream("ml2.txt"))); @@ -165,7 +165,7 @@ public void testNestedRecorGroup() throws ParseException { @Test @SuppressWarnings("rawtypes") - public void testNestedRecorGroupCollections() throws ParseException { + public void testNestedRecorGroupCollections() { BeanReader in = factory.createReader("ml3", new InputStreamReader( getClass().getResourceAsStream("ml3.txt"))); @@ -206,7 +206,7 @@ public void testNestedRecorGroupCollections() throws ParseException { } @Test - public void testRecordMap() throws ParseException { + public void testRecordMap() { BeanReader in = factory.createReader("ml4", new InputStreamReader( getClass().getResourceAsStream("ml4.txt"))); @@ -257,7 +257,7 @@ public void testRecordMap() throws ParseException { } @Test - public void testNestedRecorGroupNonCollection() throws ParseException { + public void testNestedRecorGroupNonCollection() { BeanReader in = factory.createReader("ml5", new InputStreamReader( getClass().getResourceAsStream("ml5.txt"))); @@ -286,7 +286,7 @@ public void testNestedRecorGroupNonCollection() throws ParseException { } @Test - public void testEmptyRecordList() throws ParseException { + public void testEmptyRecordList() { BeanReader in = factory.createReader("ml6", new InputStreamReader( getClass().getResourceAsStream("ml6.txt"))); @@ -306,7 +306,7 @@ public void testEmptyRecordList() throws ParseException { } @Test - public void testInlineRecordMap() throws ParseException { + public void testInlineRecordMap() { BeanReader in = factory.createReader("ml7", new InputStreamReader( getClass().getResourceAsStream("ml7.txt"))); diff --git a/test/org/beanio/parser/substitution/PropertySubstitutionParserTest.java b/test/org/beanio/parser/substitution/PropertySubstitutionParserTest.java index 8ac1010..1610fc3 100644 --- a/test/org/beanio/parser/substitution/PropertySubstitutionParserTest.java +++ b/test/org/beanio/parser/substitution/PropertySubstitutionParserTest.java @@ -60,7 +60,7 @@ public void testRuntimeSubstitution() throws ParseException { @Test @SuppressWarnings("rawtypes") - public void testDefaultSubstitution() throws ParseException { + public void testDefaultSubstitution() { Properties properties = new Properties(); properties.setProperty("dateFormat", "yyyy-MM-dd"); @@ -73,7 +73,7 @@ public void testDefaultSubstitution() throws ParseException { } @Test(expected=BeanIOConfigurationException.class) - public void testMissingProperty() throws ParseException { + public void testMissingProperty() { factory.loadResource("org/beanio/parser/substitution/substitution_mapping.xml"); } } diff --git a/test/org/beanio/stream/CsvRecordParserTest.java b/test/org/beanio/stream/CsvRecordParserTest.java index 28ec628..b6b35cf 100644 --- a/test/org/beanio/stream/CsvRecordParserTest.java +++ b/test/org/beanio/stream/CsvRecordParserTest.java @@ -227,7 +227,7 @@ public void testMarshal_CustomConfiguration() { } @Test - public void testMarshal_AlwaysQuote() throws IOException { + public void testMarshal_AlwaysQuote() { CsvRecordParserFactory factory = new CsvRecordParserFactory(); factory.setQuote('\''); factory.setEscape('\\'); diff --git a/test/org/beanio/stream/DelimitedRecordParserTest.java b/test/org/beanio/stream/DelimitedRecordParserTest.java index 49fa1ea..6fc72dc 100644 --- a/test/org/beanio/stream/DelimitedRecordParserTest.java +++ b/test/org/beanio/stream/DelimitedRecordParserTest.java @@ -38,7 +38,7 @@ public void setUp() throws Exception { } @Test - public void testUnmarshal_Basic() throws IOException { + public void testUnmarshal_Basic() { RecordUnmarshaller unmarshaller = factory.createUnmarshaller(); String[] actual = (String[]) unmarshaller.unmarshal("1\t2\t33\t444\t"); @@ -47,7 +47,7 @@ public void testUnmarshal_Basic() throws IOException { } @Test - public void testUnmarshal_EscapeDisabled() throws IOException { + public void testUnmarshal_EscapeDisabled() { factory.setEscape(null); RecordUnmarshaller unmarshaller = factory.createUnmarshaller(); @@ -57,7 +57,7 @@ public void testUnmarshal_EscapeDisabled() throws IOException { } @Test - public void testUnmarshal_EscapeEscape() throws IOException { + public void testUnmarshal_EscapeEscape() { factory.setEscape('\\'); RecordUnmarshaller unmarshaller = factory.createUnmarshaller(); @@ -67,7 +67,7 @@ public void testUnmarshal_EscapeEscape() throws IOException { } @Test - public void testUnmarshal_EscapeDelimiter() throws IOException { + public void testUnmarshal_EscapeDelimiter() { factory.setEscape('\\'); RecordUnmarshaller unmarshaller = factory.createUnmarshaller(); @@ -77,7 +77,7 @@ public void testUnmarshal_EscapeDelimiter() throws IOException { } @Test - public void testUnmarshal_EscapeOther() throws IOException { + public void testUnmarshal_EscapeOther() { factory.setEscape('\\'); RecordUnmarshaller unmarshaller = factory.createUnmarshaller(); @@ -87,7 +87,7 @@ public void testUnmarshal_EscapeOther() throws IOException { } @Test - public void testUnmarshal_CustomDelimiter() throws IOException { + public void testUnmarshal_CustomDelimiter() { factory.setDelimiter(','); RecordUnmarshaller unmarshaller = factory.createUnmarshaller(); @@ -111,14 +111,14 @@ public void testMarshal_DelimiterIsEscape() { } @Test - public void testMarshal_DefaultConfiguration() throws IOException { + public void testMarshal_DefaultConfiguration() { RecordMarshaller marshaller = factory.createMarshaller(); String record = marshaller.marshal(new String[] { "value1", "value\t2" }); assertEquals("value1\tvalue\t2", record); } @Test - public void testMarshal_CustomDelimiter() throws IOException { + public void testMarshal_CustomDelimiter() { factory.setDelimiter(','); RecordMarshaller marshaller = factory.createMarshaller(); @@ -127,7 +127,7 @@ public void testMarshal_CustomDelimiter() throws IOException { } @Test - public void testMarshal_CustomDelimiterAndEscape() throws IOException { + public void testMarshal_CustomDelimiterAndEscape() { factory.setDelimiter(','); factory.setEscape('\\'); @@ -137,14 +137,14 @@ public void testMarshal_CustomDelimiterAndEscape() throws IOException { } @Test - public void testMarshal_DefaultFactoryConfiguration() throws IOException { + public void testMarshal_DefaultFactoryConfiguration() { RecordMarshaller marshaller = factory.createMarshaller(); String record = marshaller.marshal(new String[] { "value1", "value\t2" }); assertEquals("value1\tvalue\t2", record); } @Test - public void testMarshal_CustomFactoryConfiguration() throws IOException { + public void testMarshal_CustomFactoryConfiguration() { factory.setDelimiter(','); factory.setEscape('\\'); factory.setRecordTerminator(""); diff --git a/test/org/beanio/stream/JsonReaderTest.java b/test/org/beanio/stream/JsonReaderTest.java index a965894..bf44288 100644 --- a/test/org/beanio/stream/JsonReaderTest.java +++ b/test/org/beanio/stream/JsonReaderTest.java @@ -183,7 +183,7 @@ public void test_escapedString() throws IOException { @Test @SuppressWarnings("rawtypes") - public void test_mixedArray() throws IOException { + public void test_mixedArray() { JsonRecordUnmarshaller u = new JsonRecordUnmarshaller(); Map map = u.unmarshal( @@ -197,49 +197,49 @@ public void test_mixedArray() throws IOException { } @Test - public void test_missingObject() throws IOException { + public void test_missingObject() { assertError(null, "Expected '{' near position 1"); assertError("", "Expected '{' near position 1"); assertError(" ", "Expected '{' near position 1"); } @Test - public void test_missingQuotes() throws IOException { + public void test_missingQuotes() { assertError("{ field : \"value\" }", "Expected string or '}' near position 3"); } @Test - public void test_missingCommaInObject() throws IOException { + public void test_missingCommaInObject() { assertError("{ \"f1\" : \"value\" \"f2\" : \"value2\" }", "Expected ',' or '}' near position 18"); } @Test - public void test_missingCommaInArray() throws IOException { + public void test_missingCommaInArray() { assertError("{ \"array\" : [ 10 20 ] }", "Expected ',' near position 18"); } @Test - public void test_invalidValue() throws IOException { + public void test_invalidValue() { assertError("{ \"number\" : a }", "Cannot parse 'a' into a JSON string, number or boolean near position 15"); } @Test - public void test_missingCloseObject() throws IOException { + public void test_missingCloseObject() { assertError("{ \"number\" : 10", "Expected ',' or '}' near position 15"); } @Test - public void test_missingCloseArray() throws IOException { + public void test_missingCloseArray() { assertError("{ \"number\" : [ 10", "Expected ',' or ']' near position 17"); } @Test - public void test_missingCloseString() throws IOException { + public void test_missingCloseString() { assertError("{ \"number", "Expected '\"' near position 9"); } @Test - public void test_missingColon() throws IOException { + public void test_missingColon() { assertError("{ \"number\" 10 }", "Expected ':' near position 12"); } diff --git a/test/org/beanio/types/CharacterTypeHandlerTest.java b/test/org/beanio/types/CharacterTypeHandlerTest.java index 2ac4c34..65a9b02 100644 --- a/test/org/beanio/types/CharacterTypeHandlerTest.java +++ b/test/org/beanio/types/CharacterTypeHandlerTest.java @@ -42,7 +42,7 @@ public void testParseInvalid() throws TypeConversionException { } @Test - public void testFormat() throws TypeConversionException { + public void testFormat() { CharacterTypeHandler handler = new CharacterTypeHandler(); assertEquals("V", handler.format(Character.valueOf('V'))); assertEquals("", handler.format("")); diff --git a/test/org/beanio/types/XmlBooleanTypeHandlerTest.java b/test/org/beanio/types/XmlBooleanTypeHandlerTest.java index 3b5a325..f2a5ef1 100644 --- a/test/org/beanio/types/XmlBooleanTypeHandlerTest.java +++ b/test/org/beanio/types/XmlBooleanTypeHandlerTest.java @@ -41,7 +41,7 @@ public void testParse() throws TypeConversionException { } @Test - public void testTextualFormat() throws TypeConversionException { + public void testTextualFormat() { XmlBooleanTypeHandler handler = new XmlBooleanTypeHandler(); assertFalse(handler.isNumericFormatEnabled()); assertNull(handler.format(null)); @@ -50,7 +50,7 @@ public void testTextualFormat() throws TypeConversionException { } @Test - public void testNumericFormat() throws TypeConversionException { + public void testNumericFormat() { XmlBooleanTypeHandler handler = new XmlBooleanTypeHandler(); handler.setNumericFormatEnabled(true); assertTrue(handler.isNumericFormatEnabled());