jPOS 1.6.7 API Documentation

org.jpos.iso
Class ISOFieldValidator

java.lang.Object
  extended by org.jpos.iso.ISOFieldValidator
All Implemented Interfaces:
Configurable, ReConfigurable, ISOValidator
Direct Known Subclasses:
ISOMsgFieldValidator, IVA_ALPHANUM, IVA_NUM

public class ISOFieldValidator
extends java.lang.Object
implements ReConfigurable, ISOValidator

Validator for ISOField components.

Title: jPOS

Description: Java Framework for Financial Systems

Copyright: Copyright (c) 2000 jPOS.org. All rights reserved.

Company: www.jPOS.org

Version:
1.0
Author:
Jose Eduardo Leon

Constructor Summary
ISOFieldValidator()
           
ISOFieldValidator(boolean breakOnError)
          Create a validator instance specifying breaking if any error during validation process id found.
ISOFieldValidator(boolean breakOnError, int minLen, int maxLen, java.lang.String Description)
           
ISOFieldValidator(boolean breakOnError, int maxLen, java.lang.String Description)
           
ISOFieldValidator(boolean breakOnError, java.lang.String Description)
           
ISOFieldValidator(int minLen, int maxLen, java.lang.String Description)
           
ISOFieldValidator(int maxLen, java.lang.String Description)
           
ISOFieldValidator(java.lang.String Description)
           
 
Method Summary
 boolean breakOnError()
           
 java.lang.String getDescription()
           
 int getFieldId()
           
 java.lang.String getRejCode(int ErrType)
          Get the reject code for an error type.
 void setBreakOnError(boolean breakOnErr)
           
 void setConfiguration(Configuration cfg)
          Default config params are: min-len Minimun length, max-len Max length, break-on-error break condition.
 void setDescription(java.lang.String description)
           
 void setFieldId(int f)
           
 void setMaxLength(int maxLen)
           
 void setMinLength(int minLen)
           
 ISOComponent validate(ISOComponent c)
          Validate a field component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISOFieldValidator

public ISOFieldValidator()

ISOFieldValidator

public ISOFieldValidator(java.lang.String Description)

ISOFieldValidator

public ISOFieldValidator(int maxLen,
                         java.lang.String Description)

ISOFieldValidator

public ISOFieldValidator(int minLen,
                         int maxLen,
                         java.lang.String Description)

ISOFieldValidator

public ISOFieldValidator(boolean breakOnError,
                         int minLen,
                         int maxLen,
                         java.lang.String Description)

ISOFieldValidator

public ISOFieldValidator(boolean breakOnError,
                         int maxLen,
                         java.lang.String Description)

ISOFieldValidator

public ISOFieldValidator(boolean breakOnError,
                         java.lang.String Description)

ISOFieldValidator

public ISOFieldValidator(boolean breakOnError)
Create a validator instance specifying breaking if any error during validation process id found.

Parameters:
breakOnError - break condition
Method Detail

setConfiguration

public void setConfiguration(Configuration cfg)
                      throws ConfigurationException
Default config params are: min-len Minimun length, max-len Max length, break-on-error break condition.

Specified by:
setConfiguration in interface Configurable
Parameters:
cfg - configuration instance
Throws:
ConfigurationException

setMaxLength

public void setMaxLength(int maxLen)

setMinLength

public void setMinLength(int minLen)

setBreakOnError

public void setBreakOnError(boolean breakOnErr)

breakOnError

public boolean breakOnError()

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

setFieldId

public void setFieldId(int f)

getFieldId

public int getFieldId()

getRejCode

public java.lang.String getRejCode(int ErrType)
Get the reject code for an error type. At this level is empty. It must be redefined by childs if it is necessary return an error code for specific errors. ISOVError.ERR_INVALID_LENGTH and ISOVErro.ERR_INVALID_VALUE are the defaults.

Parameters:
ErrType - Key for error type.
Returns:
the related error code. At this level return null.

validate

public ISOComponent validate(ISOComponent c)
                      throws ISOException
Validate a field component. Default for fields only consider field length validations.

Specified by:
validate in interface ISOValidator
Parameters:
c - ISOField component
Returns:
an ISOComponent result of validation process. If there area any validation error, then an ISOV component replace original c and it's returned in case of break-on-error condition is false. If break-on-error is false, then an ISOVException containing the ISOV component is raised.
Throws:
ISOException - if there are some errors during validation. It contains an ISOV component inside referencing the errors.

jPOS.org