Class GenericPackager
java.lang.Object
org.jpos.iso.ISOBasePackager
org.jpos.iso.packager.GenericPackager
- All Implemented Interfaces:
Configurable, ISOPackager, GenericPackagerParams, LogSource
- Direct Known Subclasses:
BERTLVPackager, GenericSubFieldPackager, GenericTaggedFieldsPackager, GenericValidatingPackager, GICCSubFieldPackager, TaggedSequencePackager, X92GenericPackager
GenericPackager uses an XML config file to describe the layout of an ISOMessage
The general format is as follows
<isopackager>
<isofield
id="[field id]"
name="[field name]"
length="[max field length]"
class="[org.jpos.iso.IF_*]"
pad="true|false">
</isofield>
...
</isopackager>
Fields that contain subfields can be handled as follows
<isofieldpackager
id="[field id]"
name="[field name]"
length="[field length]"
class="[org.jpos.iso.IF_*]"
packager="[org.jpos.iso.packager.*]">
<isofield
id="[subfield id]"
name="[subfield name]"
length="[max subfield length]"
class="[org.jpos.iso.IF_*]"
pad="true|false">
</isofield>
...
</isofieldpackager>
The optional attributes maxValidField, bitmapField, thirdBitmapField, and emitBitmap
are allowed on the isopackager node.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic class -
Field Summary
Fields inherited from class ISOBasePackager
fld, headerLength, logFieldName, logger, realm, thirdBitmapField -
Constructor Summary
ConstructorsConstructorDescriptionGenericPackager(InputStream input) Create a GenericPackager with the field descriptions from an XML InputStreamGenericPackager(String filename) Create a GenericPackager with the field descriptions from an XML File -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected ISOFieldPackagerprotected intusually 2 for normal fields, 1 for bitmap-less or ANSI X9.2protected intvoidreadFile(InputStream input) Parse the field descriptions from an XML InputStream.voidParse the field descriptions from an XML file.voidPackager Configuration.voidvoidMethods inherited from class ISOBasePackager
createISOMsg, fieldUnpackLogger, getFieldDescription, getFieldPackager, getHeaderLength, getLogger, getRealm, getThirdBitmapField, pack, setFieldPackager, setFieldPackager, setHeaderLength, setThirdBitmapField, unpack, unpack
-
Constructor Details
-
GenericPackager
- Throws:
ISOException
-
GenericPackager
Create a GenericPackager with the field descriptions from an XML File- Parameters:
filename- The XML field description file- Throws:
ISOException
-
GenericPackager
Create a GenericPackager with the field descriptions from an XML InputStream- Parameters:
input- The XML field description InputStream- Throws:
ISOException
-
-
Method Details
-
setConfiguration
Packager Configuration.- packager-config
- packager-logger
- packager-log-fieldname
- packager-realm
- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration- Throws:
ConfigurationException
-
getMaxValidField
- Overrides:
getMaxValidFieldin classISOBasePackager- Returns:
- 128 for ISO-8583, should return 64 for ANSI X9.2
-
emitBitMap
- Overrides:
emitBitMapin classISOBasePackager- Returns:
- true if BitMap have to be emited
-
getBitMapfieldPackager
- Overrides:
getBitMapfieldPackagerin classISOBasePackager- Returns:
- suitable ISOFieldPackager for Bitmap
-
readFile
Parse the field descriptions from an XML file.Uses the sax parser specified by the system property 'sax.parser' The default parser is org.apache.crimson.parser.XMLReaderImpl
- Parameters:
filename- The XML field description file- Throws:
ISOException
-
readFile
Parse the field descriptions from an XML InputStream.Uses the sax parser specified by the system property 'sax.parser' The default parser is org.apache.crimson.parser.XMLReaderImpl
- Parameters:
input- The XML field description InputStream- Throws:
ISOException
-
setLogger
-
getDescription
- Specified by:
getDescriptionin interfaceISOPackager- Overrides:
getDescriptionin classISOBasePackager- Returns:
- Packager's Description
-
setGenericPackagerParams
- Specified by:
setGenericPackagerParamsin interfaceGenericPackagerParams
-
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
-