Interface IBarcodescanner

All Superinterfaces:
IAnyGroup<IBarcodescanner>, IComponent<IBarcodescanner>, IHtmlBasedComponent<IBarcodescanner>, IXulElement<IBarcodescanner>

public interface IBarcodescanner extends IXulElement<IBarcodescanner>, IAnyGroup<IBarcodescanner>
Immutable Barcodescanner component

Only works for Chrome, Firefox and Edge. iOS Safari is supported since 11. (iOS WebView browsers like Chrome are not supported yet)

Support @Action

Name Action Type
onDetect ActionData: DetectData
Notifies if the barcode scanner detect a barcode message.
Author:
katherine
See Also:
  • Barcodescanner
  • Field Details

    • DEFAULT

      static final IBarcodescanner DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zkmax.barscanner.Barcodescanner"

      Specified by:
      getWidgetClass in interface IComponent<IBarcodescanner>
    • getConstraints

      @Nullable Map<String,Object> getConstraints()
      Returns the constraints. About allowed constraints setting, see MediaStreamConstraints

      Default: null.

    • withConstraints

      IBarcodescanner withConstraints(@Nullable Map<String,? extends Object> constraints)
      Returns a copy of this immutable component with the specified constraints.

      Sets the constraints. About allowed constraints setting, see MediaStreamConstraints

      Parameters:
      constraints - The constraints setting.

      Default: null.

      Returns:
      A modified copy of the this object
    • getType

      default String getType()
      Returns the types which the barcode scanner is dealing with.

      Default: "CODE128".

    • withType

      IBarcodescanner withType(String type)
      Returns a copy of this immutable component with the specified type.

      Sets the encoded and decoded type of this component. The built-in types are

      • CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
      • EAN family: EAN13, EAN8, EAN5, EAN2
      • ITF family: ITF14, ITF
      • MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
      • others: UPC, PHARMACODE , CODABAR, QR
      Some types have character and length limit. You can check it at https://en.wikipedia.org/wiki/Barcode
      Parameters:
      type - The encoded and decoded type of this component.

      Default: "CODE128".

      Returns:
      A modified copy of the this object
    • getInterval

      default double getInterval()
      Returns the scan interval of the barcode scanner.

      Default: 1000. Unit: millisecond.

    • withInterval

      IBarcodescanner withInterval(double interval)
      Returns a copy of this immutable component with the specified interval.

      Sets the scan interval of the barcode scanner.

      Parameters:
      interval - The scan interval of the barcode scanner.

      Default: 1000. Unit: millisecond.

      Returns:
      A modified copy of the this object
    • getConsistencyBufferSize

      default int getConsistencyBufferSize()
      Returns the consistency buffer size (used in 1D barcode).

      Default: 5.

    • withConsistencyBufferSize

      IBarcodescanner withConsistencyBufferSize(int consistencyBufferSize)
      Returns a copy of this immutable component with the specified consistencyBufferSize.

      Sets the consistency buffer size (used in 1D barcode).

      Parameters:
      consistencyBufferSize - The consistency buffer size (used in 1D barcode).

      Default: 5.

      Returns:
      A modified copy of the this object
    • getConsistencyThreshold

      default int getConsistencyThreshold()
      Returns the consistency threshold (used in 1D barcode). In other way, the result is required to be scanned at least N times out of consistency buffer size.

      Default: 3.

    • withConsistencyThreshold

      IBarcodescanner withConsistencyThreshold(int consistencyThreshold)
      Returns a copy of this immutable component with the specified consistencyThreshold.

      Sets the consistency threshold (used in 1D barcode).

      Parameters:
      consistencyThreshold - The consistency threshold (used in 1D barcode).

      Default: 3.

      Returns:
      A modified copy of the this object
    • getErrorAcceptance

      default double getErrorAcceptance()
      Returns the error acceptance (used in 1D barcode).

      Default: 0.1 (means 10%)

    • withErrorAcceptance

      IBarcodescanner withErrorAcceptance(double errorAcceptance)
      Returns a copy of this immutable component with the specified errorAcceptance.

      Sets the error acceptance (used in 1D barcode).

      Parameters:
      errorAcceptance - The error acceptance (used in 1D barcode).

      Default: 0.1 (means 10%).

      Returns:
      A modified copy of the this object
    • isContinuous

      default boolean isContinuous()
      Returns the continuous scan status of the barcode scanner.

      Default: false.

      Returns:
      boolean
    • withContinuous

      IBarcodescanner withContinuous(boolean continuous)
      Returns a copy of this immutable component with the specified continuous.

      Sets the continuous scan status of the barcode scanner.

      Parameters:
      continuous - The continuous scan status of the barcode scanner.

      Default: false.

      Returns:
      A modified copy of the this object
    • isEnable

      default boolean isEnable()
      Returns the enabled status of the barcode scanner.

      Default: true.

    • withEnable

      IBarcodescanner withEnable(boolean enable)
      Returns a copy of this immutable component with the specified enable.

      Sets the enabled status of the barcode scanner.

      Parameters:
      enable - The enabled status of the barcode scanner.

      Default: true.

      Returns:
      A modified copy of the this object
    • ofType

      static IBarcodescanner ofType(String type)
      Returns the instance with the given type
      Parameters:
      type - The encoded or decoded type of the component.
    • ofInterval

      static IBarcodescanner ofInterval(int interval)
      Returns the instance with the given interval

      By calling this, isContinuous() to be true.

      Parameters:
      interval - The scan interval of the barcode scanner.
    • ofId

      static IBarcodescanner ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component