jPOS 1.6.7 API Documentation

org.jpos.iso
Class ISOBinaryField

java.lang.Object
  extended by org.jpos.iso.ISOComponent
      extended by 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.

Version:
$Id: ISOBinaryField.java 2854 2010-01-02 10:34:31Z apr $
Author:
apr@cs.com.uy
See Also:
ISOComponent, Serialized Form

Constructor Summary
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
 void dump(java.io.PrintStream p, java.lang.String indent)
          dump this field to PrintStream.
 byte[] getBytes()
          get Value as bytes (when possible)
 java.lang.Object getKey()
          valid on Leafs only.
 java.lang.Object getValue()
          valid on Leafs only.
 byte[] pack()
          not available on Leaf - always throw ISOException
 void 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 ISOException
 void unpack(java.io.InputStream in)
          not available on Leaf - always throw ISOException
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.jpos.iso.ISOComponent
getChildren, getComposite, getMaxField, pack, set, unset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 - - fieldNumber
v - - fieldValue

ISOBinaryField

public ISOBinaryField(int n,
                      byte[] v,
                      int offset,
                      int len)
Parameters:
n - - fieldNumber
v - - fieldValue
offset - - starting offset
len - - 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 class ISOComponent
Parameters:
fieldNumber - new field number

pack

public byte[] pack()
            throws ISOException
not available on Leaf - always throw ISOException

Specified by:
pack in class ISOComponent
Throws:
ISOException

unpack

public int unpack(byte[] b)
           throws ISOException
not available on Leaf - always throw ISOException

Specified by:
unpack in class ISOComponent
Throws:
ISOException

unpack

public void unpack(java.io.InputStream in)
            throws ISOException
not available on Leaf - always throw ISOException

Specified by:
unpack in class ISOComponent
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 class ISOComponent
Returns:
Object representing this field number

getValue

public java.lang.Object getValue()
Description copied from class: ISOComponent
valid on Leafs only.

Overrides:
getValue in class ISOComponent
Returns:
Object representing this field value

setValue

public void setValue(java.lang.Object obj)
              throws ISOException
Specified by:
setValue in class ISOComponent
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 class ISOComponent
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 class ISOComponent
Parameters:
p - - print stream
indent - - optional indent string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.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 interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

jPOS.org