public abstract static class CommandResponder.Base extends Object implements CommandResponder
CommandResponder.AnonymousIssueException, CommandResponder.Base, CommandResponder.Session, CommandResponder.U
Modifier and Type | Field and Description |
---|---|
protected String |
keyPrefix |
protected VoterService |
voterService |
Constructor and Description |
---|
CommandResponder.Base(VoterService voterService,
String keyPrefix)
Constructs a Base.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsAnonymousIssue()
Returns false.
|
static String |
canonicalEmail(String idString,
String commandName,
CommandResponder.Session session)
Translates a personal identifier to a canonical email address.
|
String |
commandName(CommandResponder.Session session)
Returns the localized string for keyPrefix + "commandName".
|
protected static HashMap<String,Option> |
compileBaseOptions(CommandResponder.Session session)
Compiles a minimal map of options for a responder.
|
void |
help(CommandResponder.Session session)
Calls U.
|
protected int |
parse(String[] argv,
Map<String,Option> optionMap,
CommandResponder.Session session)
Parses the arguments against a formal option map, registering actual occurences in it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
respond
protected final VoterService voterService
public CommandResponder.Base(VoterService voterService, String keyPrefix)
protected static HashMap<String,Option> compileBaseOptions(CommandResponder.Session session)
public static String canonicalEmail(String idString, String commandName, CommandResponder.Session session) throws AddressException
idString
- the personal identifier as input by the user in the form
of either an email address or a mailish username.commandName
- the localized name of this command responder.AddressException
- if 'id' cannot be translated, in which case an
error message is already output to the session reply builder.protected int parse(String[] argv, Map<String,Option> optionMap, CommandResponder.Session session)
argv
- the array of command name and arguments, per respond(argv,session). It will be re-arranged so that all options come
first.optionMap
- the map against which to interpret argv.public boolean acceptsAnonymousIssue()
acceptsAnonymousIssue
in interface CommandResponder
public String commandName(CommandResponder.Session session)
commandName
in interface CommandResponder
public void help(CommandResponder.Session session)
help
in interface CommandResponder