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, unpack
public GenericPackager() throws ISOException
ISOException
public GenericPackager(java.lang.String filename) throws ISOException
filename
- The XML field description fileISOException
public GenericPackager(java.io.InputStream input) throws ISOException
input
- The XML field description InputStreamISOException
public void setConfiguration(Configuration cfg) throws ConfigurationException
setConfiguration
in interface Configurable
cfg
- ConfigurationConfigurationException
protected int getMaxValidField()
getMaxValidField
in class ISOBasePackager
protected boolean emitBitMap()
emitBitMap
in class ISOBasePackager
protected ISOFieldPackager getBitMapfieldPackager()
getBitMapfieldPackager
in class ISOBasePackager
public 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 fileISOException
public 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 InputStreamISOException
public void setLogger(Logger logger, java.lang.String realm)
setLogger
in interface LogSource
setLogger
in class ISOBasePackager
public java.lang.String getDescription()
getDescription
in interface ISOPackager
getDescription
in class ISOBasePackager
public void setGenericPackagerParams(org.xml.sax.Attributes atts)
setGenericPackagerParams
in interface GenericPackagerParams
protected int getFirstField()
ISOBasePackager
getFirstField
in class ISOBasePackager