Class ISOComponent
java.lang.Object
org.jpos.iso.ISOComponent
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ISOAmount, ISOBinaryField, ISOBitMap, ISOField, ISOMsg, ISOTaggedField
implements a Component
within a Composite pattern
See
Overview for details.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddump(PrintStream p, String indent) byte[]getBytes()get Value as bytes (when possible)dummy behaviour - return empty mapIn order to interchange Composites and Leafs we use getComposite().abstract intgetKey()valid on Leafs only.inta Composite must override this functiongetValue()valid on Leafs only.abstract byte[]pack()voidpack(OutputStream out) voidset(ISOComponent c) Set a field within this messageabstract voidsetFieldNumber(int fieldNumber) changes this Component field number
Use with care, this method does not change any reference held by a Composite.abstract voidabstract intunpack(byte[] b) abstract voidunpack(InputStream in) voidunset(int fldno) Unset a field
-
Constructor Details
-
ISOComponent
public ISOComponent()
-
-
Method Details
-
set
Set a field within this message- Parameters:
c- - a component- Throws:
ISOException
-
unset
Unset a field- Parameters:
fldno- - the field number- Throws:
ISOException
-
getComposite
In order to interchange Composites and Leafs we use getComposite(). A Composite component returns itself and a Leaf returns null. The base class ISOComponent provides Leaf functionality.- Returns:
- ISOComponent
-
getKey
valid on Leafs only. The value returned is used by ISOMsg as a key to this field.- Returns:
- object representing the field number
- Throws:
ISOException
-
getValue
valid on Leafs only.- Returns:
- object representing the field value
- Throws:
ISOException
-
getBytes
get Value as bytes (when possible)- Returns:
- byte[] representing this field
- Throws:
ISOException
-
getMaxField
a Composite must override this function- Returns:
- the max field number associated with this message
-
getChildren
dummy behaviour - return empty map- Returns:
- children (in this case 0 children)
-
setFieldNumber
changes this Component field number
Use with care, this method does not change any reference held by a Composite.- Parameters:
fieldNumber- new field number
-
getFieldNumber
-
setValue
- Throws:
ISOException
-
pack
- Throws:
ISOException
-
unpack
- Throws:
ISOException
-
dump
-
pack
- Throws:
IOExceptionISOException
-
unpack
- Throws:
IOExceptionISOException
-