Package org.jpos.iso.header
Class BaseHeader
- java.lang.Object
-
- org.jpos.iso.header.BaseHeader
-
- Direct Known Subclasses:
BASE1Header
public class BaseHeader extends java.lang.Object implements ISOHeader, Loggeable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
header
-
Constructor Summary
Constructors Constructor Description BaseHeader()
Default Constructor.BaseHeader(byte[] header)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Allow object to be cloned.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 ISOHeaderjava.lang.String
getSource()
Return the source address in this ISOHeader.boolean
isAsciiEncoding()
byte[]
pack()
Return this header as byte array.void
setAsciiEncoding(boolean asciiEncoding)
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.
-
-
-
Field Detail
-
header
protected byte[] header
-
-
Constructor Detail
-
BaseHeader
public BaseHeader()
Default Constructor. Used by Class.forName.newInstance(...);
-
BaseHeader
public BaseHeader(byte[] header)
-
-
Method Detail
-
clone
public java.lang.Object clone()
Description copied from interface:ISOHeader
Allow object to be cloned.
-
pack
public byte[] pack()
Description copied from interface:ISOHeader
Return this header as byte array.
-
unpack
public int unpack(byte[] header)
Description copied from interface:ISOHeader
Create a new ISOHeader from a byte array.
-
getLength
public int getLength()
Description copied from interface:ISOHeader
return the number of bytes in this 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 interfaceISOHeader
-
setSource
public void setSource(java.lang.String src)
Description copied from interface:ISOHeader
Set the Source address in this 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 interfaceISOHeader
-
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
-
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 interfaceISOHeader
-
dump
public void dump(java.io.PrintStream p, java.lang.String indent)
-
setAsciiEncoding
public void setAsciiEncoding(boolean asciiEncoding)
-
isAsciiEncoding
public boolean isAsciiEncoding()
-
-