Added future tolerance to Date10 and Date4 parsers; simplified the use of generics in all the FieldParseInfo subclasses. Added a test for the future tolerance of date parsers.

git-svn-id: https://j8583.svn.sourceforge.net/svnroot/j8583/j8583@85 db60a039-f72e-0410-b1d2-baa000846441
This commit is contained in:
chochos
2011-07-13 16:33:37 +00:00
parent 725d52ec4e
commit a4a21551b3
16 changed files with 131 additions and 65 deletions
@@ -35,12 +35,13 @@ public class AlphaParseInfo extends AlphaNumericFieldParseInfo {
super(IsoType.ALPHA, len);
}
public <T extends Object> IsoValue<?> parseBinary(byte[] buf, int pos, CustomField<T> custom)
public IsoValue<?> parseBinary(byte[] buf, int pos, CustomField<?> custom)
throws ParseException, UnsupportedEncodingException {
if (custom == null) {
return new IsoValue<String>(type, new String(buf, pos, length, getCharacterEncoding()), length, null);
} else {
IsoValue<T> v = new IsoValue<T>(type, custom.decodeField(new String(buf, pos, length, getCharacterEncoding())), length, custom);
@SuppressWarnings("unchecked")
IsoValue<?> v = new IsoValue(type, custom.decodeField(new String(buf, pos, length, getCharacterEncoding())), length, custom);
if (v.getValue() == null) {
return new IsoValue<String>(type, new String(buf, pos, length, getCharacterEncoding()), length, null);
}