Class PcscPluginFactoryBuilder.Builder
- java.lang.Object
-
- org.eclipse.keyple.plugin.pcsc.PcscPluginFactoryBuilder.Builder
-
- Enclosing class:
- PcscPluginFactoryBuilder
public static class PcscPluginFactoryBuilder.Builder extends java.lang.Object
Builder to build aPcscPluginFactory
.- Since:
- 2.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_CONTACTLESS_READER_FILTER
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PcscPluginFactory
build()
Returns an instance of PcscPluginFactory created from the fields set on this builder.PcscPluginFactoryBuilder.Builder
updateProtocolIdentificationRule(java.lang.String readerProtocolName, java.lang.String protocolRule)
Updates a protocol identification rule.PcscPluginFactoryBuilder.Builder
useContactlessReaderIdentificationFilter(java.lang.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.PcscPluginFactoryBuilder.Builder
useContactReaderIdentificationFilter(java.lang.String contactReaderIdentificationFilter)
Deprecated.Useless method that will be removed soon, seeuseContactlessReaderIdentificationFilter(String)
-
-
-
Field Detail
-
DEFAULT_CONTACTLESS_READER_FILTER
public static final java.lang.String DEFAULT_CONTACTLESS_READER_FILTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
useContactReaderIdentificationFilter
@Deprecated public PcscPluginFactoryBuilder.Builder useContactReaderIdentificationFilter(java.lang.String contactReaderIdentificationFilter)
Deprecated.Useless method that will be removed soon, seeuseContactlessReaderIdentificationFilter(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(java.lang.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:
java.lang.IllegalArgumentException
- If the provided string is null, empty or invalid.- Since:
- 2.0.0
- See Also:
useContactReaderIdentificationFilter(String)
-
updateProtocolIdentificationRule
public PcscPluginFactoryBuilder.Builder updateProtocolIdentificationRule(java.lang.String readerProtocolName, java.lang.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:
java.lang.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 methoduseContactlessReaderIdentificationFilter(String)
.- Returns:
- A
PcscPluginFactory
- Since:
- 2.0.0
-
-