public final class DsFormattingFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DS_CONFIGURATION
The default Dynamic Signature configuration data file inside the
library's JAR.
|
Constructor and Description |
---|
DsFormattingFactory() |
Modifier and Type | Method and Description |
---|---|
DsFormattingDevice |
createDsDevice(Token token)
Create a DS device for the given token using the default configuration
data.
|
DsFormattingDevice |
createDsDevice(Token token,
java.io.InputStream configuration)
Create a DS device for the given token using the provided configuration
data.
|
DsTransactionData |
createDsTransactionData()
Create an empty DsTransactionData.
|
public static final java.lang.String DEFAULT_DS_CONFIGURATION
public DsFormattingDevice createDsDevice(Token token) throws java.io.IOException
The default Dynamic Signature configuration is from
DEFAULT_DS_CONFIGURATION
.
token
- the tokenjava.io.IOException
- is thrown when parsing the configuration file.IdpRuntimeException
- when an exception is thrown by the json parserpublic DsFormattingDevice createDsDevice(Token token, java.io.InputStream configuration) throws java.io.IOException
Android Example: It assumes the DS configuration file is stored as an
Android project resource file at res/raw/dsConf.json
.
// context is an android.content.Context object InputStream is = context.getResources().openRawResource(R.raw.dsConf)); DsDevice device = DsFactory.createDsDevice(token, is);
token
- the tokenconfiguration
- the custom Dynamic Signature configuration data to
apply to this device.java.io.IOException
- is thrown when parsing the configuration file.IdpRuntimeException
- when an exception is thrown by the json
parserpublic DsTransactionData createDsTransactionData()