Class ISOBaseValidatingPackager
java.lang.Object
org.jpos.iso.ISOBasePackager
org.jpos.iso.packager.ISOBaseValidatingPackager
- All Implemented Interfaces:
ISOPackager, ISOValidator, LogSource
- Direct Known Subclasses:
CTCSubElementPackager, CTCSubFieldPackager
Base Packager class envolving validators. It implements
ISOValidator interface and define an implementation for validate method.
Validation is for composed components.
Title: jPOS
Description: Java Framework for Financial Systems
Copyright: Copyright (c) 2000 jPOS.org. All rights reserved.
Company: www.jPOS.org
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ISOValidator[]field validator array.protected ISOBaseValidator[]Message level validatorsFields 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 TypeMethodDescriptionvoidsetFieldValidator(ISOValidator[] fvlds) Sets the array of field validators.voidsetMsgValidator(ISOBaseValidator[] msgVlds) Sets the array of message-level validators.Validates an ISOComponent.Methods inherited from class ISOBasePackager
createISOMsg, emitBitMap, fieldUnpackLogger, getBitMapfieldPackager, getDescription, getFieldDescription, getFieldPackager, getFirstField, getHeaderLength, getLogger, getMaxValidField, getRealm, getThirdBitmapField, pack, setFieldPackager, setFieldPackager, setHeaderLength, setLogger, setThirdBitmapField, unpack, unpackModifier and TypeMethodDescriptionFactory hook returning theISOMsgsubclass produced during unpack.protected booleanIndicates whether a primary bitmap is emitted on pack.protected static voidfieldUnpackLogger(LogEvent evt, int fldno, ISOComponent c, ISOFieldPackager fld, boolean logFieldName) Internal helper logging function.protected ISOFieldPackagerReturns the field packager used for the primary bitmap.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.protected intusually 2 for normal fields, 1 for bitmap-less or ANSI X9.2intReturns 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.byte[]pack(ISOComponent m) pack method that works in conjunction withISOBasePackager.unpack(ISOComponent, byte[]).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.intunpack(ISOComponent m, byte[] b) Unpacks an ISO-8583 byte array into the given message container.voidunpack(ISOComponent m, InputStream in) Unpacks an ISO-8583 message from an input stream into the given container.
-
Field Details
-
msgVld
Message level validators -
fldVld
field validator array.
-
-
Constructor Details
-
ISOBaseValidatingPackager
public ISOBaseValidatingPackager()Default constructor.
-
-
Method Details
-
validate
Description copied from interface:ISOValidatorValidates an ISOComponent.- Specified by:
validatein interfaceISOValidator- Parameters:
m- the ISO component to validate- Returns:
- the validated (possibly modified) component
- Throws:
ISOException- if break-on-error is assumed and there are some errors
-
setFieldValidator
Sets the array of field validators.- Parameters:
fvlds- the field validator array
-
setMsgValidator
Sets the array of message-level validators.- Parameters:
msgVlds- the message validator array
-