Class ICCDataPackager
java.lang.Object
org.jpos.iso.ISOBasePackager
org.jpos.iso.packager.GenericPackager
org.jpos.iso.packager.DatasetPackager
org.jpos.iso.packager.ICCDataPackager
- All Implemented Interfaces:
Configurable, ISODatasetPackager, ISOPackager, ISOSubFieldPackager, GenericPackagerParams, LogSource
Special-case packager for DE 055 ICC data, which carries raw BER-TLV without
the standard dataset identifier and length envelope.
-
Nested Class Summary
Nested classes/interfaces inherited from class GenericPackager
GenericPackager.GenericContentHandler, GenericPackager.GenericEntityResolverModifier and TypeClassDescriptionclassSAX content handler that builds the packager's field structure from the DTD-driven XML.static classSAX entity resolver that maps the GenericPackager DTD URIs to bundled resources. -
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanICC data is encoded as raw BER-TLV, without the standard dataset identifier and length envelope.byte[]pack(ISOComponent m) Packs raw ICC BER-TLV bytes without the standard dataset envelope.intunpack(ISOComponent m, byte[] b) Unpacks raw ICC BER-TLV bytes into a synthetic dataset keyed by the outer field number.voidunpack(ISOComponent m, InputStream in) Unpacks raw ICC BER-TLV bytes from a stream.Methods inherited from class DatasetPackager
getFieldNumber, packDatasetContent, packDBM, packTLV, resolveDatasetFormat, setGenericPackagerParams, unpackDataset, unpackDBM, unpackTLVModifier and TypeMethodDescriptionintReturns the outer ISO field number this dataset packager is bound to.protected byte[]packDatasetContent(Dataset dataset) Packs the inner dataset payload without the outer dataset envelope.protected byte[]Encodes a DBM dataset payload.protected byte[]Encodes a TLV dataset payload.protected DatasetFormatresolveDatasetFormat(int identifier) Resolves the format implied by a dataset identifier.voidCaptures the outer field id declared in the XML packager definition.protected DatasetunpackDataset(int identifier, DatasetFormat format, byte[] content) Decodes a dataset payload without the outer dataset envelope.protected ISODatasetunpackDBM(int identifier, byte[] content) Decodes a DBM dataset payload.protected ISODatasetunpackTLV(int identifier, byte[] content) Decodes a TLV dataset payload.Methods inherited from class GenericPackager
emitBitMap, getBitMapfieldPackager, getDescription, getFirstField, getMaxValidField, readFile, readFile, setConfiguration, setLoggerModifier and TypeMethodDescriptionprotected booleanIndicates whether a primary bitmap is emitted on pack.protected ISOFieldPackagerReturns the field packager used for the primary bitmap.Returns a human-readable description of this packager.protected intusually 2 for normal fields, 1 for bitmap-less or ANSI X9.2protected intReturns the highest valid field number for this packager.voidreadFile(InputStream input) Parse the field descriptions from an XML InputStream.voidParse the field descriptions from an XML file.voidPackager Configuration.voidAttaches aLoggerand realm to this log source.Methods inherited from class ISOBasePackager
createISOMsg, fieldUnpackLogger, getFieldDescription, getFieldPackager, getHeaderLength, getLogger, getRealm, getThirdBitmapField, setFieldPackager, setFieldPackager, setHeaderLength, setThirdBitmapFieldModifier 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.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.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.voidsetThirdBitmapField(int f) Configures the Data Element field that holds the tertiary bitmap.
-
Constructor Details
-
ICCDataPackager
Creates an ICC data packager.- Throws:
ISOException- on packager initialization errors
-
-
Method Details
-
hasDatasetEnvelope
ICC data is encoded as raw BER-TLV, without the standard dataset identifier and length envelope.- Returns:
- always
false
-
pack
Packs raw ICC BER-TLV bytes without the standard dataset envelope.- Specified by:
packin interfaceISOPackager- Overrides:
packin classDatasetPackager- Parameters:
m- ICC dataset field- Returns:
- packed BER-TLV bytes
- Throws:
ISOException- on packing errors
-
unpack
Unpacks raw ICC BER-TLV bytes into a synthetic dataset keyed by the outer field number.- Specified by:
unpackin interfaceISOPackager- Overrides:
unpackin classDatasetPackager- Parameters:
m- destination dataset fieldb- BER-TLV bytes- Returns:
- number of bytes consumed
- Throws:
ISOException- on unpacking errors
-
unpack
Unpacks raw ICC BER-TLV bytes from a stream.- Specified by:
unpackin interfaceISOPackager- Overrides:
unpackin classDatasetPackager- Parameters:
m- destination dataset fieldin- source stream- Throws:
IOException- on stream errorsISOException- on unpacking errors
-