public class UsageTokenManager extends Object
| Constructor and Description |
|---|
UsageTokenManager(String usageExpression,
Class<?> dataClass) |
| Modifier and Type | Method and Description |
|---|---|
UsageToken |
findUsageToken(String option) |
Method |
getSetterMethod(UsageToken usageToken) |
void |
initialize()
Initialize and update the data structures representing mandatory and optional usage tokens
|
boolean |
isMissingMandatoryOption(Set<UsageToken> availableUsageTokens) |
boolean |
noTokensAvailable() |
void |
validateVariableNames()
Validate the data class for mandatory and optional usage tokens
|
public void initialize()
public void validateVariableNames()
IllegalArgumentException - If data class is not validpublic boolean isMissingMandatoryOption(Set<UsageToken> availableUsageTokens)
availableUsageTokens - Set of usage options as available in the command line argumentspublic UsageToken findUsageToken(String option)
option - The option as present in the usage expression, e.g. m in usage expression -m minute [-s seconds] is an optionIllegalArgumentException - If corresponding usage token could not be foundpublic boolean noTokensAvailable()
public Method getSetterMethod(UsageToken usageToken)
usageToken - The usage token corresponding to the optionCopyright © 2017. All rights reserved.