Class CheckScannerProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.checkscanner.CheckScannerProperties
All Implemented Interfaces:
CheckScannerInterface, JposBaseInterface

public class CheckScannerProperties extends JposCommonProperties implements CheckScannerInterface
Class containing the check scanner specific properties, their default values and default implementations of CheckScannerInterface. For details about properties, methods and method parameters, see UPOS specification, chapter Check Scanner.
  • Field Details

    • InsertionMode

      public boolean InsertionMode
      This property will be used internally to verify whether BeginInsertion and EndInsertion are valid operations. It will be initialized to false during device enable.
    • RemovalMode

      public boolean RemovalMode
      This property will be used internally to verify whether BeginRemoval and EndRemoval are valid operations. It will be initialized to false during device enable.
    • CapAutoContrast

      public boolean CapAutoContrast
      UPOS property CapAutoContrast. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapAutoGenerateFileID

      public boolean CapAutoGenerateFileID
      UPOS property CapAutoGenerateFileID. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapAutoGenerateImageTagData

      public boolean CapAutoGenerateImageTagData
      UPOS property CapAutoGenerateImageTagData. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapAutoSize

      public boolean CapAutoSize
      UPOS property CapAutoSize. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapColor

      public int CapColor
      UPOS property CapColor. Default: CCL_MONO. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapConcurrentMICR

      public boolean CapConcurrentMICR
      UPOS property CapConcurrentMICR. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapContrast

      public boolean CapContrast
      UPOS property CapContrast. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapDefineCropArea

      public boolean CapDefineCropArea
      UPOS property CapDefineCropArea. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapImageFormat

      public int CapImageFormat
      UPOS property CapImageFormat. Default: CIF_NATIVE. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapImageTagData

      public boolean CapImageTagData
      UPOS property CapImageTagData. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapMICRDevice

      public boolean CapMICRDevice
      UPOS property CapMICRDevice. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapStoreImageFiles

      public boolean CapStoreImageFiles
      UPOS property CapStoreImageFiles. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CapValidationDevice

      public boolean CapValidationDevice
      UPOS property CapValidationDevice. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • Color

      public Integer Color
      UPOS property Color. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method if CapColor specifies more than one color.
    • ConcurrentMICR

      public Boolean ConcurrentMICR
      UPOS property ConcurrentMICR. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method if CapMICRDevice and CapConcurrentMICR are true.
    • ContrastDef

      public Integer ContrastDef
      Default value of Contrast property. Default: null. Can be updated before calling initOnEnable the first time if CapContrast is true and CapAutoContrast is false.
    • Contrast

      public Integer Contrast
      UPOS property Contrast. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • CropAreaCount

      public int CropAreaCount
      UPOS property CropAreaCount. Default: 0. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • DocumentHeightDef

      public Integer DocumentHeightDef
      Default for UPOS property DocumentHeight. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method. Keep in mind that the initial value must be given in 0.001 inch units by default. Will also be used in ClearDataProperties method if CapAutoSize is true to restore DocumentHeight.
    • DocumentHeight

      public int DocumentHeight
      UPOS property DocumentHeight.
    • DocumentWidthDef

      public Integer DocumentWidthDef
      Default for UPOS property DocumentWidth. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method. Keep in mind that the initial value must be given in 0.001 inch units by default. Will also be used in ClearDataProperties method if CapAutoSize is true to restore DocumentWidth.
    • DocumentWidth

      public int DocumentWidth
      UPOS property DocumentWidth.
    • FileID

      public String FileID
      UPOS property FileID. Default: An empty string.
    • FileIndex

      public int FileIndex
      UPOS property FileIndex.
    • ImageData

      public byte[] ImageData
      UPOS property ImageData. Default: A zero-length byte array.
    • ImageFormat

      public Integer ImageFormat
      UPOS property ImageFormat. Default: null. If CapImageFormat specifies more than one format, it must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • ImageMemoryStatusDef

      public int ImageMemoryStatusDef
      Default value of ImageMemoryStatus property. Default: IMS_OK. Should be updated before calling initOnClaim.
    • ImageMemoryStatus

      public int ImageMemoryStatus
      UPOS property ImageMemoryStatus. Default: 0. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • ImageTagData

      public String ImageTagData
      UPOS property ImageTagData. Default: An empty string. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • MapMode

      public int MapMode
      UPOS property MapMode. Default: MM_ENGLISH. Can be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method. If overwritten, DocumentHeight and DocumentWidth must be given in the corresponding units.
    • MaxCropAreas

      public Integer MaxCropAreas
      UPOS property MaxCropAreas. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • Quality

      public Integer Quality
      UPOS property Quality. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method if QualityList contains more than one resolution.
    • QualityList

      public String QualityList
      UPOS property QualityList. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
    • RemainingImagesEstimate

      public Integer RemainingImagesEstimate
      UPOS property RemainingImagesEstimate. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults or checkProperties method.
  • Constructor Details

    • CheckScannerProperties

      protected CheckScannerProperties(int dev)
      Constructor.
      Parameters:
      dev - Device index
  • Method Details

    • initOnOpen

      public void initOnOpen()
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during open.
      Overrides:
      initOnOpen in class JposCommonProperties
    • initOnClaim

      public void initOnClaim()
      Description copied from class: JposCommonProperties
      Initialize properties that must be initialized whenever the device will be claimed.
      Overrides:
      initOnClaim in class JposCommonProperties
    • initOnFirstEnable

      public boolean initOnFirstEnable()
      Description copied from class: JposCommonProperties
      Initialize properties that must be initialized whenever the device will be enabled the first time-
      Overrides:
      initOnFirstEnable in class JposCommonProperties
      Returns:
      Returns true in case of first enable.
    • initOnEnable

      public void initOnEnable(boolean enable)
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during deviceEnable.
      Overrides:
      initOnEnable in class JposCommonProperties
      Parameters:
      enable - True: initialize properties, false: do nothing
    • checkMandatoryProperties

      public void checkMandatoryProperties() throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Checks whether mandatory properties can be set to plausible values due to specific capability values. If so, these properties will be set to the corresponding values. Otherwise, these properties must be initialized either in the Device's changeDefaults or checkProperties method.
      A call of this method in a CheckScanner device factory after the call of the Device's checkProperties method is mandatory.
      Specified by:
      checkMandatoryProperties in interface CheckScannerInterface
      Throws:
      jpos.JposException - If one of the mandatory properties has not been set previously.
    • color

      public void color(int color) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting Color. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • color is one of CL_MONO, CL_GRAYSCALE, CL_16, CL_256 or CL_FULL,
      • the corresponding bit in CapColor (CCL_MONO, ...) is set.
      Specified by:
      color in interface CheckScannerInterface
      Parameters:
      color - New value for Color property.
      Throws:
      jpos.JposException - If an error occurs.
    • concurrentMICR

      public void concurrentMICR(boolean concurrentMICR) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting ConcurrentMICR. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • CapMICRDevice is false or CapConcurrentMICR is true or concurrentMICR is false,
      • internal property AllowAlwaysSetProperties is true or concurrentMICR equals the previous value of ConcurrentMICR.
      Specified by:
      concurrentMICR in interface CheckScannerInterface
      Parameters:
      concurrentMICR - New value for ConcurrentMICR property.
      Throws:
      jpos.JposException - If an error occurs.
    • contrast

      public void contrast(int contrast) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting Contrast. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • 0 ≤ contrast %le; 100 or contrast = AUTOMATIC_CONTRAST and CapAutoContrast = true.
      Specified by:
      contrast in interface CheckScannerInterface
      Parameters:
      contrast - New value for Contrast property.
      Throws:
      jpos.JposException - If an error occurs.
    • documentHeight

      public void documentHeight(int documentHeight) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting DocumentHeight. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • documentHeight is not negative,
      • documentHeight in combination with MapMode does not specify a height above the initial DocumentHeight value,
      • internal property AllowAlwaysSetProperties is true or documentHeight equals the previous value of DocumentHeight.
      Specified by:
      documentHeight in interface CheckScannerInterface
      Parameters:
      documentHeight - New value for DocumentHeight property.
      Throws:
      jpos.JposException - If an error occurs.
    • documentWidth

      public void documentWidth(int documentWidth) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting DocumentWidth. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • documentWidth is not negative,
      • documentWidth in combination with MapMode does not specify a width above the initial DocumentWidth value,
      • internal property AllowAlwaysSetProperties is true or documentWidth equals the previous value of DocumentWidth.
      Specified by:
      documentWidth in interface CheckScannerInterface
      Parameters:
      documentWidth - New value for DocumentWidth property.
      Throws:
      jpos.JposException - If an error occurs.
    • fileID

      public void fileID(String fileID) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting FileID. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • fileID is not null,
      • internal property AllowAlwaysSetProperties is true or fileID equals the previous value of FileID.
      Specified by:
      fileID in interface CheckScannerInterface
      Parameters:
      fileID - New value for FileID property.
      Throws:
      jpos.JposException - If an error occurs.
    • fileIndex

      public void fileIndex(int fileIndex) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting FileIndex. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • internal property AllowAlwaysSetProperties is true or fileIndex equals the previous value of FileIndex.
      Specified by:
      fileIndex in interface CheckScannerInterface
      Parameters:
      fileIndex - New value for FileIndex property.
      Throws:
      jpos.JposException - If an error occurs.
    • imageFormat

      public void imageFormat(int imageFormat) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting ImageFormat. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • imageFormat is one of IF_NATIVE, IF_TIFF, IF_BMP, IF_JPEG, or IF_GIF,
      • the corresponding bit in CapImageFormat (CIF_NATIVE, ...) is set,
      • internal property AllowAlwaysSetProperties is true or imageFormat equals the previous value of ImageFormat.
      Specified by:
      imageFormat in interface CheckScannerInterface
      Parameters:
      imageFormat - New value for ImageFormat property.
      Throws:
      jpos.JposException - If an error occurs.
    • imageTagData

      public void imageTagData(String imageTagData) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting ImageTagData. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • imageTagData is not null,
      • internal property AllowAlwaysSetProperties is true or imageTagData equals the previous value of ImageTagData.
      Specified by:
      imageTagData in interface CheckScannerInterface
      Parameters:
      imageTagData - New value for ImageTagData property.
      Throws:
      jpos.JposException - If an error occurs.
    • getMM_Factors

      public int[][] getMM_Factors()
      Returns array containing the MapMode values and the corresponding units per inch.
      Returns:
      Array containing value pairs for MM_DOTS, MM_TWIPS, MM_ENGLISH and MM_METRIC.
    • getMM_Factor

      public Integer getMM_Factor(int mode)
      Compute the size of one inch for the given MapMode constant. For MM_Metric, this is 2540 (since one inch equals 25.4 millimeter). For MM_DOTS, his is the value specified by property Quality. For MM_ENGLISH and MM_TWIPS this is 1000 / 1440, corresponding to the MapMode specification.
      Parameters:
      mode - MapMode constant, valid values are MM_DOTS, MM_TWIPS, MM_ENGLISH and MM_METRIC.
      Returns:
      Current MapMode units for one inch or null if mode is not a valid MapMode constant.
    • mapMode

      public void mapMode(int mapMode) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting MapMode. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • mapMode is one of MM_DOTS, MM_TWIPS, MM_ENGLISH or MM_METRIC,
      • internal property AllowAlwaysSetProperties is true or mapMode equals the previous value of MapMode.
      Specified by:
      mapMode in interface CheckScannerInterface
      Parameters:
      mapMode - New value for MapMode property.
      Throws:
      jpos.JposException - If an error occurs.
    • quality

      public void quality(int quality) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of setting Quality. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • quality is one of the values stored in the QualityList property,
      • internal property AllowAlwaysSetProperties is true or quality equals the previous value of Quality.
      Specified by:
      quality in interface CheckScannerInterface
      Parameters:
      quality - New value for Quality property.
      Throws:
      jpos.JposException - If an error occurs.
    • beginInsertion

      public void beginInsertion(int timeout) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of BeginInsertion method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • timeout is positive or FOREVER.
      If the service enters insertion mode successfully after BeginInsertion failed, e.g. due to a timeout condition during delayed asynchronous insertion handling, property InsertionMode must be set to true by the specific service implementation to avoid EndInsertion to fail.
      Specified by:
      beginInsertion in interface CheckScannerInterface
      Parameters:
      timeout - Maximum time in milliseconds BeginInsertion delays execution.
      Throws:
      jpos.JposException - If an error occurs or in case of a timeout.
    • beginRemoval

      public void beginRemoval(int timeout) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of BeginRemoval method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • timeout is positive or FOREVER.
      If the service enters removal mode successfully after BeginRemoval failed, e.g. due to a timeout condition during delayed asynchronous removal handling, property RemovalMode must be set to true by the specific service implementation to avoid EndRemoval to fail.
      Specified by:
      beginRemoval in interface CheckScannerInterface
      Parameters:
      timeout - Maximum time in milliseconds BeginRemoval delays execution.
      Throws:
      jpos.JposException - If an error occurs or in case of a timeout.
    • clearImage

      public void clearImage(int by) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of ClearImage method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • by is one of CLR_ALL, CLR_BY_FILEID, CLR_BY_FILEINDEX or CLR_BY_IMAGETAGDATA.
      Specified by:
      clearImage in interface CheckScannerInterface
      Parameters:
      by - One of CLR_ALL, CLR_BY_FILEID, CLR_BY_FILEINDEX or CLR_BY_IMAGETAGDATA, specifies which properties will be used to access the device's image storage.
      Throws:
      jpos.JposException - If an error occurs.
    • defineCropArea

      public void defineCropArea(int cropAreaID, int x, int y, int cx, int cy) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of DefineCropArea method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • cropAreaID equals CROP_AREA_RESET_ALL or
        • CapDefineCropArea is true,
        • x between 0 and DocumentWidth,
        • y between 0 and DocumentHeight,
        • cx between 0 and DocumentWidth - x and
        • cy between 0 and DocumentHeight - y.
        Remark: If cx equals CROP_AREA_RIGHT or cy equals CROP_AREA_BOTTOM, the service computes the corresponding real cx or cy value from the corresponding image dimensions using the current MapMode.
      Specified by:
      defineCropArea in interface CheckScannerInterface
      Parameters:
      cropAreaID - Crop area identifier to be used.
      x - Starting x coordinate of the cropping area.
      y - Starting y coordinate of the cropping area.
      cx - Value to be added to x coordinate to compute the ending x coordinate of the cropping area.
      cy - Value to be added to y coordinate to compute the ending y coordinate of the cropping area.
      Throws:
      jpos.JposException - If an error occurs.
    • endInsertion

      public void endInsertion() throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of EndInsertion method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • Device entered insertion mode previously.
      Specified by:
      endInsertion in interface CheckScannerInterface
      Throws:
      jpos.JposException - If an error occurs.
    • endRemoval

      public void endRemoval() throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of EndRemoval method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • Device entered removal mode previously.
      Specified by:
      endRemoval in interface CheckScannerInterface
      Throws:
      jpos.JposException - If an error occurs.
    • retrieveImage

      public void retrieveImage(int cropAreaID) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of RetrieveImage method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • cropAreaID equals CROP_AREA_ENTIRE_IMAGE or CapDefineCropArea is true,
      • Device is neither in insertion nor in removal mode (no outstanding EndInsertion or EndRemoval).
      Specified by:
      retrieveImage in interface CheckScannerInterface
      Parameters:
      cropAreaID - Crop area ID as specified in DefineCropArea or CROP_AREA_ENTIRE_IMAGE.
      Throws:
      jpos.JposException - If an error occurs.
    • retrieveMemory

      public void retrieveMemory(int by) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of RetrieveMemory method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • CapStoreImageFiles is true,
      • by equals LOCATE_BY_FILEID and FileID is a non-empty string or
      • by equals LOCATE_BY_FILEINDEX or
      • by equals LOCATE_BY_IMAGETAGDATA, CapImageTagData is true and ImageTagData is a non-empty string.
      Specified by:
      retrieveMemory in interface CheckScannerInterface
      Parameters:
      by - One of LOCATE_BY_FILEID, LOCATE_BY_FILEINDEX or LOCATE_BY_IMAGETAGDATA.
      Throws:
      jpos.JposException - If an error occurs.
    • storeImage

      public void storeImage(int cropAreaID) throws jpos.JposException
      Description copied from interface: CheckScannerInterface
      Final part of StoreImage method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • CapStoreImageFiles is true,
      • CapDefineCropArea is true or cropAreaID equals CROP_AREA_ENTIRE_IMAGE.
      Specified by:
      storeImage in interface CheckScannerInterface
      Parameters:
      cropAreaID - Crop area ID as specified in DefineCropArea or CROP_AREA_ENTIRE_IMAGE.
      Throws:
      jpos.JposException - If an error occurs.
    • clearDataProperties

      public void clearDataProperties()
      Description copied from class: JposCommonProperties
      Clear data properties. Performed during ClearInput and ClearInputProperties.
      Overrides:
      clearDataProperties in class JposCommonProperties