Package org.jpos.iso
Class ISOBinaryField
- java.lang.Object
-
- org.jpos.iso.ISOComponent
-
- org.jpos.iso.ISOBinaryField
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
public class ISOBinaryField extends ISOComponent implements java.lang.Cloneable, java.io.Externalizable
implements Leaf for binary fields See the API User's Guide for details.- See Also:
ISOComponent
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
fieldNumber
protected byte[]
value
-
Constructor Summary
Constructors Constructor Description ISOBinaryField()
No args constructor (required by Externalizable support on ISOMsg)ISOBinaryField(int n)
ISOBinaryField(int n, byte[] v)
ISOBinaryField(int n, byte[] v, int offset, int len)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(java.io.PrintStream p, java.lang.String indent)
dump this field to PrintStream.byte[]
getBytes()
get Value as bytes (when possible)int
getFieldNumber()
java.lang.Object
getKey()
valid on Leafs only.java.lang.Object
getValue()
valid on Leafs only.byte[]
pack()
not available on Leaf - always throw ISOExceptionvoid
readExternal(java.io.ObjectInput in)
void
setFieldNumber(int fieldNumber)
changes this Component field number
Use with care, this method does not change any reference held by a Composite.void
setValue(java.lang.Object obj)
java.lang.String
toString()
int
unpack(byte[] b)
not available on Leaf - always throw ISOExceptionvoid
unpack(java.io.InputStream in)
not available on Leaf - always throw ISOExceptionvoid
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.jpos.iso.ISOComponent
getChildren, getComposite, getMaxField, pack, set, unset
-
-
-
-
Field Detail
-
fieldNumber
protected int fieldNumber
-
value
protected byte[] value
-
-
Constructor Detail
-
ISOBinaryField
public ISOBinaryField()
No args constructor (required by Externalizable support on ISOMsg)
-
ISOBinaryField
public ISOBinaryField(int n)
- Parameters:
n
- - the FieldNumber
-
ISOBinaryField
public ISOBinaryField(int n, byte[] v)
- Parameters:
n
- - fieldNumberv
- - fieldValue
-
ISOBinaryField
public ISOBinaryField(int n, byte[] v, int offset, int len)
- Parameters:
n
- - fieldNumberv
- - fieldValueoffset
- - starting offsetlen
- - field length
-
-
Method Detail
-
setFieldNumber
public void setFieldNumber(int fieldNumber)
changes this Component field number
Use with care, this method does not change any reference held by a Composite.- Specified by:
setFieldNumber
in classISOComponent
- Parameters:
fieldNumber
- new field number
-
getFieldNumber
public int getFieldNumber()
- Specified by:
getFieldNumber
in classISOComponent
-
pack
public byte[] pack() throws ISOException
not available on Leaf - always throw ISOException- Specified by:
pack
in classISOComponent
- Throws:
ISOException
-
unpack
public int unpack(byte[] b) throws ISOException
not available on Leaf - always throw ISOException- Specified by:
unpack
in classISOComponent
- Throws:
ISOException
-
unpack
public void unpack(java.io.InputStream in) throws ISOException
not available on Leaf - always throw ISOException- Specified by:
unpack
in classISOComponent
- Throws:
ISOException
-
getKey
public java.lang.Object getKey()
Description copied from class:ISOComponent
valid on Leafs only. The value returned is used by ISOMsg as a key to this field.- Overrides:
getKey
in classISOComponent
- Returns:
- Object representing this field number
-
getValue
public java.lang.Object getValue()
Description copied from class:ISOComponent
valid on Leafs only.- Overrides:
getValue
in classISOComponent
- Returns:
- Object representing this field value
-
setValue
public void setValue(java.lang.Object obj) throws ISOException
- Specified by:
setValue
in classISOComponent
- Parameters:
obj
- - Object representing this field value- Throws:
ISOException
-
getBytes
public byte[] getBytes()
Description copied from class:ISOComponent
get Value as bytes (when possible)- Overrides:
getBytes
in classISOComponent
- Returns:
- byte[] representing this field
-
dump
public void dump(java.io.PrintStream p, java.lang.String indent)
dump this field to PrintStream. The output is sorta XML, intended to be easily parsed.- Specified by:
dump
in classISOComponent
- Parameters:
p
- - print streamindent
- - optional indent string
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-