org.jpos.iso
Class ISOFieldPackager

java.lang.Object
  extended by org.jpos.iso.ISOFieldPackager
Direct Known Subclasses:
IF_ECHAR, IF_NOP, IF_TBASE, IF_UNUSED, IFA_LLABINARY, IFA_LLBNUM, IFA_LLLABINARY, IFB_AMOUNT, IFB_LLHFBINARY, IFEB_LLLNUM, IFEB_LLNUM, IFEP_LLCHAR, IFIPM_LLLCHAR, ISOAmountFieldPackager, ISOBinaryFieldPackager, ISOBitMapPackager, ISOFilledStringFieldPackager, ISOMsgFieldPackager, ISOStringFieldPackager, ISOTagStringFieldPackager

public abstract class ISOFieldPackager
extends Object

base class for the various IF*.java Field Packagers Implements "FlyWeight" pattern

Version:
$Id$
Author:
apr@cs.com.uy
See Also:
IFA_AMOUNT, IFA_BINARY, IFA_BITMAP, IFA_FLLCHAR, IFA_FLLNUM, IFA_LLCHAR, IFA_LLLBINARY, IFA_LLLCHAR, IFA_LLLNUM, IFA_LLNUM, IFA_NUMERIC, IFB_AMOUNT, IFB_BINARY, IFB_BITMAP, IFB_LLBINARY, IFB_LLCHAR, IFB_LLHBINARY, IFB_LLHCHAR, IFB_LLHECHAR, IFB_LLHNUM, IFB_LLLBINARY, IFB_LLLCHAR, IFB_LLLNUM, IFB_LLNUM, IFB_NUMERIC, IF_CHAR, IF_ECHAR

Field Summary
protected  boolean pad
           
 
Constructor Summary
ISOFieldPackager()
          Default Constructor
ISOFieldPackager(int len, String description)
           
 
Method Summary
 ISOComponent createComponent(int fieldNumber)
           
 String getDescription()
           
 int getLength()
           
abstract  int getMaxPackedLength()
           
abstract  byte[] pack(ISOComponent c)
           
 void pack(ISOComponent c, ObjectOutput out)
           
protected  byte[] readBytes(InputStream in, int l)
           
 void setDescription(String description)
           
 void setLength(int len)
           
 void setPad(boolean pad)
           
abstract  int unpack(ISOComponent c, byte[] b, int offset)
           
 void unpack(ISOComponent c, InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pad

protected boolean pad
Constructor Detail

ISOFieldPackager

public ISOFieldPackager()
Default Constructor


ISOFieldPackager

public ISOFieldPackager(int len,
                        String description)
Parameters:
len - - field Len
description - - details
Method Detail

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getLength

public int getLength()

setLength

public void setLength(int len)

setPad

public void setPad(boolean pad)

getMaxPackedLength

public abstract int getMaxPackedLength()

createComponent

public ISOComponent createComponent(int fieldNumber)

pack

public abstract byte[] pack(ISOComponent c)
                     throws ISOException
Parameters:
c - - a component
Returns:
packed component
Throws:
ISOException

unpack

public abstract int unpack(ISOComponent c,
                           byte[] b,
                           int offset)
                    throws ISOException
Parameters:
c - - the Component to unpack
b - - binary image
offset - - starting offset within the binary image
Returns:
consumed bytes
Throws:
ISOException

unpack

public void unpack(ISOComponent c,
                   InputStream in)
            throws IOException,
                   ISOException
Parameters:
c - - the Component to unpack
in - - input stream
Throws:
ISOException
IOException

pack

public void pack(ISOComponent c,
                 ObjectOutput out)
          throws IOException,
                 ISOException
Parameters:
c - - the Component to unpack
out - - output stream
Throws:
ISOException
IOException

readBytes

protected byte[] readBytes(InputStream in,
                           int l)
                    throws IOException
Throws:
IOException


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