Enum DecodeHintType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DecodeHintType>

    public enum DecodeHintType
    extends java.lang.Enum<DecodeHintType>
    Encapsulates a type of hint that a caller may pass to a barcode reader to help it more quickly or accurately decode it. It is up to implementations to decide what, if anything, to do with the information that is supplied.
    See Also:
    Reader.decode(BinaryBitmap,java.util.Map)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALLOWED_EAN_EXTENSIONS
      Allowed extension lengths for EAN or UPC barcodes.
      ALLOWED_LENGTHS
      Allowed lengths of encoded data -- reject anything else.
      ALSO_INVERTED
      If true, also tries to decode as inverted image.
      ASSUME_CODE_39_CHECK_DIGIT
      Assume Code 39 codes employ a check digit.
      ASSUME_GS1
      Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
      CHARACTER_SET
      Specifies what character encoding to use when decoding, where applicable (type String)
      NEED_RESULT_POINT_CALLBACK
      The caller needs to be notified via callback when a possible ResultPoint is found.
      OTHER
      Unspecified, application-specific hint.
      POSSIBLE_FORMATS
      Image is known to be of one of a few possible formats.
      PURE_BARCODE
      Image is a pure monochrome image of a barcode.
      RETURN_CODABAR_START_END
      If true, return the start and end digits in a Codabar barcode instead of stripping them.
      TRY_HARDER
      Spend more time to try to find a barcode; optimize for accuracy, not speed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> valueType
      Data type the hint is expecting.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DecodeHintType​(java.lang.Class<?> valueType)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<?> getValueType()  
      static DecodeHintType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DecodeHintType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • OTHER

        public static final DecodeHintType OTHER
        Unspecified, application-specific hint. Maps to an unspecified Object.
      • PURE_BARCODE

        public static final DecodeHintType PURE_BARCODE
        Image is a pure monochrome image of a barcode. Doesn't matter what it maps to; use Boolean.TRUE.
      • POSSIBLE_FORMATS

        public static final DecodeHintType POSSIBLE_FORMATS
        Image is known to be of one of a few possible formats. Maps to a List of BarcodeFormats.
      • TRY_HARDER

        public static final DecodeHintType TRY_HARDER
        Spend more time to try to find a barcode; optimize for accuracy, not speed. Doesn't matter what it maps to; use Boolean.TRUE.
      • CHARACTER_SET

        public static final DecodeHintType CHARACTER_SET
        Specifies what character encoding to use when decoding, where applicable (type String)
      • ALLOWED_LENGTHS

        public static final DecodeHintType ALLOWED_LENGTHS
        Allowed lengths of encoded data -- reject anything else. Maps to an int[].
      • ASSUME_CODE_39_CHECK_DIGIT

        public static final DecodeHintType ASSUME_CODE_39_CHECK_DIGIT
        Assume Code 39 codes employ a check digit. Doesn't matter what it maps to; use Boolean.TRUE.
      • ASSUME_GS1

        public static final DecodeHintType ASSUME_GS1
        Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed. For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to; use Boolean.TRUE.
      • RETURN_CODABAR_START_END

        public static final DecodeHintType RETURN_CODABAR_START_END
        If true, return the start and end digits in a Codabar barcode instead of stripping them. They are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them to not be. Doesn't matter what it maps to; use Boolean.TRUE.
      • ALLOWED_EAN_EXTENSIONS

        public static final DecodeHintType ALLOWED_EAN_EXTENSIONS
        Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this. Maps to an int[] of the allowed extension lengths, for example [2], [5], or [2, 5]. If it is optional to have an extension, do not set this hint. If this is set, and a UPC or EAN barcode is found but an extension is not, then no result will be returned at all.
      • ALSO_INVERTED

        public static final DecodeHintType ALSO_INVERTED
        If true, also tries to decode as inverted image. All configured decoders are simply called a second time with an inverted image. Doesn't matter what it maps to; use Boolean.TRUE.
    • Field Detail

      • valueType

        private final java.lang.Class<?> valueType
        Data type the hint is expecting. Among the possible values the Void stands out as being used for hints that do not expect a value to be supplied (flag hints). Such hints will possibly have their value ignored, or replaced by a Boolean.TRUE. Hint suppliers should probably use Boolean.TRUE as directed by the actual hint documentation.
    • Constructor Detail

      • DecodeHintType

        private DecodeHintType​(java.lang.Class<?> valueType)
    • Method Detail

      • values

        public static DecodeHintType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DecodeHintType c : DecodeHintType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DecodeHintType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValueType

        public java.lang.Class<?> getValueType()