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
.
<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