Package org.jpos.tlv
Class ISOTaggedField
- java.lang.Object
-
- org.jpos.iso.ISOComponent
-
- org.jpos.tlv.ISOTaggedField
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ISOTaggedField extends ISOComponent
-
-
Constructor Summary
Constructors Constructor Description ISOTaggedField(java.lang.String tag, ISOComponent delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(java.io.PrintStream p, java.lang.String indent)
byte[]
getBytes()
get Value as bytes (when possible)java.util.Map
getChildren()
dummy behaviour - return empty mapISOComponent
getComposite()
In order to interchange Composites and Leafs we use getComposite().ISOComponent
getDelegate()
int
getFieldNumber()
java.lang.Object
getKey()
valid on Leafs only.int
getMaxField()
a Composite must override this functionjava.lang.String
getTag()
java.lang.Object
getValue()
valid on Leafs only.byte[]
pack()
void
pack(java.io.OutputStream out)
void
set(ISOComponent c)
Set a field within this messagevoid
setFieldNumber(int fieldNumber)
changes this Component field number
Use with care, this method does not change any reference held by a Composite.void
setTag(java.lang.String tag)
void
setValue(java.lang.Object obj)
int
unpack(byte[] b)
void
unpack(java.io.InputStream in)
void
unset(int fldno)
Unset a field
-
-
-
Constructor Detail
-
ISOTaggedField
public ISOTaggedField(java.lang.String tag, ISOComponent delegate)
-
-
Method Detail
-
getTag
public java.lang.String getTag()
-
setTag
public void setTag(java.lang.String tag)
-
setFieldNumber
public void setFieldNumber(int fieldNumber)
Description copied from class:ISOComponent
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
-
setValue
public void setValue(java.lang.Object obj) throws ISOException
- Specified by:
setValue
in classISOComponent
- Throws:
ISOException
-
set
public void set(ISOComponent c) throws ISOException
Description copied from class:ISOComponent
Set a field within this message- Overrides:
set
in classISOComponent
- Parameters:
c
- - a component- Throws:
ISOException
-
unset
public void unset(int fldno) throws ISOException
Description copied from class:ISOComponent
Unset a field- Overrides:
unset
in classISOComponent
- Parameters:
fldno
- - the field number- Throws:
ISOException
-
getComposite
public ISOComponent getComposite()
Description copied from class:ISOComponent
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.- Overrides:
getComposite
in classISOComponent
- Returns:
- ISOComponent
-
getKey
public java.lang.Object getKey() throws ISOException
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 the field number
- Throws:
ISOException
-
getValue
public java.lang.Object getValue() throws ISOException
Description copied from class:ISOComponent
valid on Leafs only.- Overrides:
getValue
in classISOComponent
- Returns:
- object representing the field value
- Throws:
ISOException
-
getBytes
public byte[] getBytes() throws ISOException
Description copied from class:ISOComponent
get Value as bytes (when possible)- Overrides:
getBytes
in classISOComponent
- Returns:
- byte[] representing this field
- Throws:
ISOException
-
getMaxField
public int getMaxField()
Description copied from class:ISOComponent
a Composite must override this function- Overrides:
getMaxField
in classISOComponent
- Returns:
- the max field number associated with this message
-
getChildren
public java.util.Map getChildren()
Description copied from class:ISOComponent
dummy behaviour - return empty map- Overrides:
getChildren
in classISOComponent
- Returns:
- children (in this case 0 children)
-
pack
public void pack(java.io.OutputStream out) throws java.io.IOException, ISOException
- Overrides:
pack
in classISOComponent
- Throws:
java.io.IOException
ISOException
-
dump
public void dump(java.io.PrintStream p, java.lang.String indent)
- Specified by:
dump
in classISOComponent
-
pack
public byte[] pack() throws ISOException
- Specified by:
pack
in classISOComponent
- Throws:
ISOException
-
unpack
public int unpack(byte[] b) throws ISOException
- Specified by:
unpack
in classISOComponent
- Throws:
ISOException
-
unpack
public void unpack(java.io.InputStream in) throws java.io.IOException, ISOException
- Specified by:
unpack
in classISOComponent
- Throws:
java.io.IOException
ISOException
-
getDelegate
public ISOComponent getDelegate()
-
-