Class ISOBinaryField
java.lang.Object
org.jpos.iso.ISOComponent
org.jpos.iso.ISOBinaryField
- All Implemented Interfaces:
Externalizable, Serializable, Cloneable
implements Leaf for binary fields
See the
API User's Guide
for details.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe ISO field number.protected byte[]The raw binary value. -
Constructor Summary
ConstructorsConstructorDescriptionNo args constructor (required by Externalizable support on ISOMsg)ISOBinaryField(int n) Constructs a binary field with the given field number.ISOBinaryField(int n, byte[] v) Constructs a binary field.ISOBinaryField(int n, byte[] v, int offset, int len) Constructs a binary field. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) dump this field to PrintStream.byte[]getBytes()get Value as bytes (when possible)intReturns the field number this component occupies within its container.getKey()valid on Leafs only.getValue()valid on Leafs only.byte[]pack()not available on Leaf - always throw ISOExceptionvoidvoidsetFieldNumber(int fieldNumber) changes this Component field number
Use with care, this method does not change any reference held by a Composite.voidSets the value of this component.toString()intunpack(byte[] b) not available on Leaf - always throw ISOExceptionvoidunpack(InputStream in) not available on Leaf - always throw ISOExceptionvoidMethods inherited from class ISOComponent
getChildren, getComposite, getMaxField, pack, set, unsetModifier and TypeMethodDescriptiondummy behaviour - return empty mapIn order to interchange Composites and Leafs we use getComposite().inta Composite must override this functionvoidpack(OutputStream out) Packs this component and writes it toout.voidset(ISOComponent c) Set a field within this messagevoidunset(int fldno) Unset a field
-
Field Details
-
fieldNumber
The ISO field number. -
value
The raw binary value.
-
-
Constructor Details
-
ISOBinaryField
public ISOBinaryField()No args constructor (required by Externalizable support on ISOMsg) -
ISOBinaryField
Constructs a binary field with the given field number.- Parameters:
n- - the FieldNumber
-
ISOBinaryField
Constructs a binary field.- Parameters:
n- - fieldNumberv- - fieldValue
-
ISOBinaryField
Constructs a binary field.- Parameters:
n- - fieldNumberv- - fieldValueoffset- - starting offsetlen- - field length
-
-
Method Details
-
setFieldNumber
changes this Component field number
Use with care, this method does not change any reference held by a Composite.- Specified by:
setFieldNumberin classISOComponent- Parameters:
fieldNumber- new field number
-
getFieldNumber
Description copied from class:ISOComponentReturns the field number this component occupies within its container.- Specified by:
getFieldNumberin classISOComponent- Returns:
- the field number
-
pack
not available on Leaf - always throw ISOException- Specified by:
packin classISOComponent- Returns:
- packed bytes
- Throws:
ISOException- on ISO processing error
-
unpack
not available on Leaf - always throw ISOException- Specified by:
unpackin classISOComponent- Parameters:
b- packed bytes- Returns:
- number of bytes consumed
- Throws:
ISOException- on ISO processing error
-
unpack
not available on Leaf - always throw ISOException- Specified by:
unpackin classISOComponent- Parameters:
in- source stream- Throws:
ISOException- on ISO processing error
-
getKey
Description copied from class:ISOComponentvalid on Leafs only. The value returned is used by ISOMsg as a key to this field.- Overrides:
getKeyin classISOComponent- Returns:
- Object representing this field number
-
getValue
Description copied from class:ISOComponentvalid on Leafs only.- Overrides:
getValuein classISOComponent- Returns:
- Object representing this field value
-
setValue
Description copied from class:ISOComponentSets the value of this component.- Specified by:
setValuein classISOComponent- Parameters:
obj- - Object representing this field value- Throws:
ISOException- on ISO processing error
-
getBytes
Description copied from class:ISOComponentget Value as bytes (when possible)- Overrides:
getBytesin classISOComponent- Returns:
- byte[] representing this field
-
dump
dump this field to PrintStream. The output is sorta XML, intended to be easily parsed.- Specified by:
dumpin classISOComponent- Parameters:
p- - print streamindent- - optional indent string
-
toString
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-