Class PcscPluginFactoryBuilder.Builder

java.lang.Object
org.eclipse.keyple.plugin.pcsc.PcscPluginFactoryBuilder.Builder
Enclosing class:
PcscPluginFactoryBuilder

public static class PcscPluginFactoryBuilder.Builder extends Object
Builder to build a PcscPluginFactory.
Since:
2.0.0
  • Method Details

    • useContactReaderIdentificationFilter

      @Deprecated public PcscPluginFactoryBuilder.Builder useContactReaderIdentificationFilter(String contactReaderIdentificationFilter)
      Deprecated.
      Useless method that will be removed soon, see useContactlessReaderIdentificationFilter(String)
      Sets a filter based on regular expressions to make the plugin able to identify a contact reader from its name.

      Readers whose names match the provided regular expression will be considered contact type readers.

      For example, the string ".*less.*" could identify all readers having "less" in their name as contactless readers.

      Names are not always as explicit, so it is sometimes better to test the brand and model.
      Commonly used contact readers include "Cherry TC" or "Identive".
      Thus, an application using these readers should call this method with ".*(Cherry TC|Identive).*" as an argument.

      Parameters:
      contactReaderIdentificationFilter - A string a regular expression.
      Returns:
      This builder.
      Since:
      2.0.0
    • useContactlessReaderIdentificationFilter

      public PcscPluginFactoryBuilder.Builder useContactlessReaderIdentificationFilter(String contactlessReaderIdentificationFilter)
      Overwrites the default filter with the provided filter based on regular expressions to make the plugin able to identify a contact reader from its name.

      Readers whose names match the provided regular expression will be considered contactless type readers.

      The default value is "(?i).*(contactless|ask logo|acs acr122).*"

      Parameters:
      contactlessReaderIdentificationFilter - A regular expression.
      Returns:
      This builder.
      Throws:
      IllegalArgumentException - If the provided string is null, empty or invalid.
      Since:
      2.0.0
      See Also:
    • updateProtocolIdentificationRule

      public PcscPluginFactoryBuilder.Builder updateProtocolIdentificationRule(String readerProtocolName, String protocolRule)
      Updates a protocol identification rule.

      A protocol rule is a regular expression contained in a String.

      • If a rule already exists for the provided protocol, it is replaced.
      • If no rule exists for the provided protocol, it is added.
      • If the rule is null, the protocol is disabled.
      Parameters:
      readerProtocolName - A not empty String.
      protocolRule - null to disable the protocol.
      Returns:
      This builder.
      Throws:
      IllegalArgumentException - If one of the argument is null or empty
      Since:
      2.0.0
    • build

      public PcscPluginFactory build()
      Returns an instance of PcscPluginFactory created from the fields set on this builder.

      The type of reader is determined using a regular expression applied to its name.
      The default regular expression is "(?i).*(contactless|ask logo|acs acr122).*".
      Readers that do not match this regular expression are considered contact type.
      It is possible to redefine the contactless reader filter via the method useContactlessReaderIdentificationFilter(String).

      Returns:
      A PcscPluginFactory
      Since:
      2.0.0