org.jpos.iso
Class ISOField

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

public class ISOField
extends ISOComponent
implements Cloneable, Externalizable

implements Leaf for standard fields

Version:
$Id$
Author:
apr@cs.com.uy
See Also:
ISOComponent, Serialized Form

Field Summary
protected  int fieldNumber
           
protected  String value
           
 
Constructor Summary
ISOField()
          No args constructor (required by Externalizable support on ISOMsg)
ISOField(int n)
           
ISOField(int n, String v)
           
 
Method Summary
 void dump(PrintStream p, String indent)
          dump this field to PrintStream.
 byte[] getBytes()
          get Value as bytes (when possible)
 Object getKey()
          valid on Leafs only.
 Object getValue()
          valid on Leafs only.
 byte[] pack()
          not available on Leaf - always throw ISOException
 void readExternal(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(Object obj)
           
 int unpack(byte[] b)
          not available on Leaf - always throw ISOException
 void unpack(InputStream in)
          not available on Leaf - always throw ISOException
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.jpos.iso.ISOComponent
getChildren, getComposite, getMaxField, pack, set, unset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldNumber

protected int fieldNumber

value

protected String value
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,
                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(InputStream in)
            throws ISOException
not available on Leaf - always throw ISOException

Specified by:
unpack in class ISOComponent
Throws:
ISOException

getKey

public 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 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(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(PrintStream p,
                 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(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException


Copyright © 1998-2012 jPOS.org. All Rights Reserved.