jPOS 1.6.7 API Documentation

org.jpos.iso
Class ISOField

java.lang.Object
  extended by org.jpos.iso.ISOComponent
      extended by org.jpos.iso.ISOField
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ISOVField

public class ISOField
extends ISOComponent
implements java.lang.Cloneable, java.io.Externalizable

implements Leaf for standard fields

Version:
$Id: ISOField.java 2871 2010-02-03 09:49:40Z marklsalter $
Author:
apr@cs.com.uy
See Also:
ISOComponent, Serialized Form

Constructor Summary
ISOField()
          No args constructor (required by Externalizable support on ISOMsg)
ISOField(int n)
           
ISOField(int n, java.lang.String v)
           
 
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)
           
 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, toString, wait, wait, wait
 

Constructor Detail

ISOField

public ISOField()
No args constructor (required by Externalizable support on ISOMsg)


ISOField

public ISOField(int n)
Parameters:
n - - the FieldNumber

ISOField

public ISOField(int n,
                java.lang.String v)
Parameters:
n - - fieldNumber
v - - fieldValue
Method Detail

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

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

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