public interface TokenFactory
DefaultTokenFactory
for an implementation that stores tokens in the
Java Preference system and can interactively query the user for the required
parameters if they don't have a saved token.
The tokens produced by a TokenFactory
must be instances of a class
which is annotated with Token
, and with fields annotated with
Parameter
.
Modifier and Type | Method and Description |
---|---|
<T> T |
getToken(Class<T> tokenClass)
Get the default token for the given class.
|
<T> T |
getToken(Class<T> tokenClass,
String name)
Get the token for the given class, tagged with a specific name.
|
<T> T getToken(Class<T> tokenClass)
If a predefined token is unavailable, the token might be built by the underlying implementation; for example by interacting with the user.
tokenClass
- the class of the token to build<T> T getToken(Class<T> tokenClass, String name)
If a predefined token is unavailable, the token might be built by the underlying implementation; for example by interacting with the user.
tokenClass
- the class of the token to buildname
- the name of the token