Class ISOMsgFieldValidatingPackager
java.lang.Object
org.jpos.iso.ISOFieldPackager
org.jpos.iso.ISOMsgFieldPackager
org.jpos.iso.packager.ISOMsgFieldValidatingPackager
- All Implemented Interfaces:
ISOValidator
THIS CLASS SHOWS THAT IsoMsgFieldValidator IS NOT NECESSARY. IF WE
MODIFY CURRENT PACKAGER ISOMsgFieldPackager. IF IT IMPLEMENTS ISOValidator
INTERFACE, AND ADD validate(ISOComponent c) METHOD LIKE HERE. IN
TesterValidatingPackager FILE WE COULD CHANGE FIELD 48 VALIDATOR TO
THAT NEW ISOMsgFieldValidator. SEE COMMENTED LINE.
Title: jPOS
Description: Java Framework for Financial Systems
Copyright: Copyright (c) 2000 jPOS.org. All rights reserved.
Company: www.jPOS.org
-
Field Summary
Fields inherited from class ISOMsgFieldPackager
fieldPackager, msgPackagerModifier and TypeFieldDescriptionprotected ISOFieldPackagerThe field-level packager.protected ISOPackagerThe message-level packager.Fields inherited from class ISOFieldPackager
pad, trim -
Constructor Summary
ConstructorsConstructorDescriptionISOMsgFieldValidatingPackager(ISOFieldPackager fieldPackager, ISOPackager msgPackager) Constructs the validating packager from a field packager and a nested message packager. -
Method Summary
Modifier and TypeMethodDescriptionValidates an ISOComponent.Methods inherited from class ISOMsgFieldPackager
createComponent, getISOFieldPackager, getISOMsgPackager, getMaxPackedLength, pack, unpack, unpackModifier and TypeMethodDescriptioncreateComponent(int fieldNumber) Creates anISOComponentinstance appropriate for this packager.Returns the ISO field packager.Returns the ISO message packager.intReturns the maximum number of bytes this packager can produce.byte[]pack(ISOComponent c) Packs the given component into a byte array.intunpack(ISOComponent c, byte[] b, int offset) Unpacks a field from the binary image into the given component.voidunpack(ISOComponent c, InputStream in) Unpacks a field from an input stream into the given component.Methods inherited from class ISOFieldPackager
getDescription, getLength, pack, readBytes, setDescription, setLength, setPad, setTrimModifier and TypeMethodDescriptionReturns the field description.intReturns the maximum field length.voidpack(ISOComponent c, ObjectOutput out) Packs the component to an ObjectOutput stream.protected byte[]readBytes(InputStream in, int l) Reads exactlylbytes from the input stream.voidsetDescription(String description) Sets the field description.voidsetLength(int len) Sets the maximum field length.voidsetPad(boolean pad) Enables or disables padding for this field.voidsetTrim(boolean trim) Enables or disables trimming for this field.
-
Constructor Details
-
ISOMsgFieldValidatingPackager
Constructs the validating packager from a field packager and a nested message packager.- Parameters:
fieldPackager- packager for the wrapping fieldmsgPackager- packager that handles the inner ISO message
-
-
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
-