public class GenericPackager extends ISOBasePackager implements Configurable, GenericPackagerParams
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.
ISOPackager,
ISOBasePackager| Modifier and Type | Class and Description |
|---|---|
class |
GenericPackager.GenericContentHandler |
static class |
GenericPackager.GenericEntityResolver |
fld, headerLength, logFieldName, logger, realm, thirdBitmapField| Constructor and Description |
|---|
GenericPackager() |
GenericPackager(java.io.InputStream input)
Create a GenericPackager with the field descriptions
from an XML InputStream
|
GenericPackager(java.lang.String filename)
Create a GenericPackager with the field descriptions
from an XML File
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
emitBitMap() |
protected ISOFieldPackager |
getBitMapfieldPackager() |
java.lang.String |
getDescription() |
protected int |
getFirstField()
usually 2 for normal fields, 1 for bitmap-less or ANSI X9.2
|
protected int |
getMaxValidField() |
void |
readFile(java.io.InputStream input)
Parse the field descriptions from an XML InputStream.
|
void |
readFile(java.lang.String filename)
Parse the field descriptions from an XML file.
|
void |
setConfiguration(Configuration cfg)
Packager Configuration.
|
void |
setGenericPackagerParams(org.xml.sax.Attributes atts) |
void |
setLogger(Logger logger,
java.lang.String realm) |
createISOMsg, fieldUnpackLogger, getFieldDescription, getFieldPackager, getHeaderLength, getLogger, getRealm, getThirdBitmapField, pack, setFieldPackager, setFieldPackager, setHeaderLength, setThirdBitmapField, unpack, unpackpublic GenericPackager()
throws ISOException
ISOExceptionpublic GenericPackager(java.lang.String filename)
throws ISOException
filename - The XML field description fileISOExceptionpublic GenericPackager(java.io.InputStream input)
throws ISOException
input - The XML field description InputStreamISOExceptionpublic void setConfiguration(Configuration cfg) throws ConfigurationException
setConfiguration in interface Configurablecfg - ConfigurationConfigurationExceptionprotected int getMaxValidField()
getMaxValidField in class ISOBasePackagerprotected boolean emitBitMap()
emitBitMap in class ISOBasePackagerprotected ISOFieldPackager getBitMapfieldPackager()
getBitMapfieldPackager in class ISOBasePackagerpublic void readFile(java.lang.String filename)
throws ISOException
Uses the sax parser specified by the system property 'sax.parser' The default parser is org.apache.crimson.parser.XMLReaderImpl
filename - The XML field description fileISOExceptionpublic void readFile(java.io.InputStream input)
throws ISOException
Uses the sax parser specified by the system property 'sax.parser' The default parser is org.apache.crimson.parser.XMLReaderImpl
input - The XML field description InputStreamISOExceptionpublic void setLogger(Logger logger, java.lang.String realm)
setLogger in interface LogSourcesetLogger in class ISOBasePackagerpublic java.lang.String getDescription()
getDescription in interface ISOPackagergetDescription in class ISOBasePackagerpublic void setGenericPackagerParams(org.xml.sax.Attributes atts)
setGenericPackagerParams in interface GenericPackagerParamsprotected int getFirstField()
ISOBasePackagergetFirstField in class ISOBasePackager