public abstract class AbstractCardSelection<T extends AbstractApduCommandBuilder>
extends java.lang.Object
CardSelectionRequest
and analyse its result.
It embeds a CardSelector
provided at construction and offers methods to manage
additional APDU command builders.
The resulting CardSelectionRequest
will be used as a selection case in the general
selection process implemented in CardSelectionsService
.
This class can also be extended to add specific features to a family of cards and create
specific instances of AbstractSmartCard
in return for the parse method.
Modifier and Type | Field and Description |
---|---|
protected CardSelector |
cardSelector |
Modifier | Constructor and Description |
---|---|
protected |
AbstractCardSelection(CardSelector cardSelector)
(protected)
Constructor. |
Modifier and Type | Method and Description |
---|---|
protected void |
addCommandBuilder(T commandBuilder)
Add an additional
AbstractApduCommandBuilder for the command to be executed after the
selection process if it succeeds. |
CardSelector |
getCardSelector() |
protected java.util.List<T> |
getCommandBuilders()
Gets the list of command builders.
|
protected abstract AbstractSmartCard |
parse(CardSelectionResponse cardSelectionResponse)
Parsing method to be implemented in a card specific extension.
|
protected final CardSelector cardSelector
protected AbstractCardSelection(CardSelector cardSelector)
cardSelector
- A not null CardSelector
.public CardSelector getCardSelector()
protected final void addCommandBuilder(T commandBuilder)
AbstractApduCommandBuilder
for the command to be executed after the
selection process if it succeeds.
If more than one AbstractApduCommandBuilder
is added, all will be executed in the
order in which they were added.
commandBuilder
- an AbstractApduCommandBuilder
protected final java.util.List<T> getCommandBuilders()
protected abstract AbstractSmartCard parse(CardSelectionResponse cardSelectionResponse)
It returns an instance of AbstractSmartCard
created from the data collected in the
selection step (FCI, other data if any).
cardSelectionResponse
- the card response receivedAbstractSmartCard
KeypleException
- if an error occurs while parsing the card response