The new copyFieldsFrom() method had problems with fields that had CustomField encoders. A getter has been added to IsoValue for the CustomField and it's used in the copyFieldsFrom() method.

git-svn-id: https://j8583.svn.sourceforge.net/svnroot/j8583/j8583@58 db60a039-f72e-0410-b1d2-baa000846441
This commit is contained in:
chochos
2010-11-30 02:29:37 +00:00
parent 4c02b3989d
commit 2c501c3f43
2 changed files with 6 additions and 1 deletions
@@ -355,7 +355,7 @@ public class IsoMessage {
for (int i : idx) {
IsoValue<?> v = src.getField(i);
if (v != null) {
setValue(i, v.getValue(), v.getType(), v.getLength());
setValue(i, v.getValue(), v.getEncoder(), v.getType(), v.getLength());
}
}
}
@@ -177,6 +177,11 @@ public class IsoValue<T> implements Cloneable {
return value == null ? 0 : toString().hashCode();
}
/** Returns the CustomField encoder for this value. */
public CustomField<T> getEncoder() {
return encoder;
}
/** Writes the formatted value to a stream, with the length header
* if it's a variable length type. */
public void write(OutputStream outs, boolean binary) throws IOException {