Class Base1SubFieldPackager
java.lang.Object
org.jpos.iso.ISOBasePackager
org.jpos.iso.packager.Base1SubFieldPackager
- All Implemented Interfaces:
ISOPackager, LogSource
- Direct Known Subclasses:
Base1Packager.F126Packager
ISO 8583 v1987 BINARY Packager
customized for VISA Base1 subfields
- See Also:
-
Field Summary
Fields inherited from class ISOBasePackager
fld, headerLength, logFieldName, logger, realm, thirdBitmapFieldModifier and TypeFieldDescriptionprotected ISOFieldPackager[]Per-field packagers indexed by field number.protected intNumber of leading bytes treated as the ISO header during unpack.protected booleanWhentrue, field descriptions are emitted as XML comments in unpack logs.protected LoggerLogger used to record pack/unpack diagnostics;nulldisables logging.protected StringLogger realm associated with this packager.protected intField number that carries the tertiary bitmap as a Data Element, or-999if not used. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor; no instance state to initialise. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanIndicates whether a primary bitmap is emitted on pack.protected ISOFieldPackagerReturns the field packager used for the primary bitmap.protected intusually 2 for normal fields, 1 for bitmap-less or ANSI X9.2byte[]pack(ISOComponent m) Pack the subfield into a byte arrayintunpack(ISOComponent m, byte[] b) Unpack a packed subfield into its corresponding ISOComponentMethods inherited from class ISOBasePackager
createISOMsg, fieldUnpackLogger, getDescription, getFieldDescription, getFieldPackager, getHeaderLength, getLogger, getMaxValidField, getRealm, getThirdBitmapField, setFieldPackager, setFieldPackager, setHeaderLength, setLogger, setThirdBitmapField, unpackModifier and TypeMethodDescriptionFactory hook returning theISOMsgsubclass produced during unpack.protected static voidfieldUnpackLogger(LogEvent evt, int fldno, ISOComponent c, ISOFieldPackager fld, boolean logFieldName) Internal helper logging function.Returns a human-readable description of this packager.getFieldDescription(ISOComponent m, int fldNumber) Returns the human-readable description of a field as defined by its packager.getFieldPackager(int fldNumber) Returns the field packager registered for the given field number.intReturns the configured ISO header length in bytes.Returns the Logger associated with this source.protected intReturns the highest valid field number for this packager.getRealm()Returns the log realm associated with this source.intReturns the field number carrying the tertiary bitmap as a Data Element.voidsetFieldPackager(int fldNumber, ISOFieldPackager fieldPackager) Replaces the packager registered for a single field.voidsetFieldPackager(ISOFieldPackager[] fld) Replaces the per-field packager array.voidsetHeaderLength(int len) Sets the ISO header length in bytes.voidAttaches aLoggerand realm to this log source.voidsetThirdBitmapField(int f) Configures the Data Element field that holds the tertiary bitmap.voidunpack(ISOComponent m, InputStream in) Unpacks an ISO-8583 message from an input stream into the given container.
-
Constructor Details
-
Base1SubFieldPackager
public Base1SubFieldPackager()Default constructor; no instance state to initialise.
-
-
Method Details
-
emitBitMap
Description copied from class:ISOBasePackagerIndicates whether a primary bitmap is emitted on pack.- Overrides:
emitBitMapin classISOBasePackager- Returns:
trueif the field-1 packager is anISOBitMapPackager
-
getFirstField
Description copied from class:ISOBasePackagerusually 2 for normal fields, 1 for bitmap-less or ANSI X9.2- Overrides:
getFirstFieldin classISOBasePackager- Returns:
- first valid field
-
getBitMapfieldPackager
Description copied from class:ISOBasePackagerReturns the field packager used for the primary bitmap.- Overrides:
getBitMapfieldPackagerin classISOBasePackager- Returns:
- suitable ISOFieldPackager for Bitmap
-
unpack
Unpack a packed subfield into its corresponding ISOComponent- Specified by:
unpackin interfaceISOPackager- Overrides:
unpackin classISOBasePackager- Parameters:
m- the Container of this messageb- ISO message image- Returns:
- consumed bytes
- Throws:
ISOException- if the message image cannot be unpacked
-
pack
Pack the subfield into a byte array- Specified by:
packin interfaceISOPackager- Overrides:
packin classISOBasePackager- Parameters:
m- the Component to pack- Returns:
- Message image
- Throws:
ISOException- if the component cannot be packed
-