jPOS 1.6.1 API Documentation

org.jpos.iso.header
Class BaseHeader

java.lang.Object
  extended by org.jpos.iso.header.BaseHeader
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ISOHeader, Loggeable
Direct Known Subclasses:
BASE1Header

public class BaseHeader
extends java.lang.Object
implements ISOHeader, Loggeable

Author:
Eoin Flood, Alejandro P. Revilla
See Also:
Serialized Form

Constructor Summary
BaseHeader()
          Default Constructor.
BaseHeader(byte[] header)
          Create a new Header from a byte array.
 
Method Summary
 java.lang.Object clone()
          Clone this Header.
 void dump(java.io.PrintStream p, java.lang.String indent)
           
 java.lang.String getDestination()
          Return the destination address in this ISOHeader.
 int getLength()
          return the number of bytes in this ISOHeader
 java.lang.String getSource()
          Return the source address in this ISOHeader.
 byte[] pack()
          Return this header as byte array.
 void setDestination(java.lang.String dst)
          Set the Destination address in this ISOHeader.
 void setSource(java.lang.String src)
          Set the Source address in this ISOHeader.
 void swapDirection()
          Swap the source and destination addresses in this ISOHeader (if they exist).
 int unpack(byte[] header)
          Create a new ISOHeader from a byte array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseHeader

public BaseHeader()
Default Constructor. Used by Class.forName.newInstance(...);


BaseHeader

public BaseHeader(byte[] header)
Create a new Header from a byte array.

Method Detail

clone

public java.lang.Object clone()
Clone this Header.

Specified by:
clone in interface ISOHeader
Overrides:
clone in class java.lang.Object

pack

public byte[] pack()
Description copied from interface: ISOHeader
Return this header as byte array.

Specified by:
pack in interface ISOHeader

unpack

public int unpack(byte[] header)
Description copied from interface: ISOHeader
Create a new ISOHeader from a byte array.

Specified by:
unpack in interface ISOHeader
Returns:
The Number of bytes consumed.

getLength

public int getLength()
Description copied from interface: ISOHeader
return the number of bytes in this ISOHeader

Specified by:
getLength in interface ISOHeader

setDestination

public void setDestination(java.lang.String dst)
Description copied from interface: ISOHeader
Set the Destination address in this ISOHeader.

Specified by:
setDestination in interface ISOHeader

setSource

public void setSource(java.lang.String src)
Description copied from interface: ISOHeader
Set the Source address in this ISOHeader.

Specified by:
setSource in interface ISOHeader

getDestination

public java.lang.String getDestination()
Description copied from interface: ISOHeader
Return the destination address in this ISOHeader. returns null if there is no destination address

Specified by:
getDestination in interface ISOHeader

getSource

public java.lang.String getSource()
Description copied from interface: ISOHeader
Return the source address in this ISOHeader. returns null if there is no source address

Specified by:
getSource in interface ISOHeader

swapDirection

public void swapDirection()
Description copied from interface: ISOHeader
Swap the source and destination addresses in this ISOHeader (if they exist).

Specified by:
swapDirection in interface ISOHeader

dump

public void dump(java.io.PrintStream p,
                 java.lang.String indent)
Specified by:
dump in interface Loggeable

jPOS.org