Eluinhost/pluginframework — pull request #26 by Eluinhost (2014-08-27 15:32:36+00:00)
Title: Make method signature allow options

Adds:

**Method Arguments**

Changes method signature of @CommandMethod methods to allow for direct passing of objects.

Parameter 1 - Must be an OptionSet, the parsed options
Parameter 2 - Must be a CommandSender, or a subclass if defined in the annotation
Parameters 3+ - Arguments, their posistion defined by 'optionOrder' in the annotation. Special case '[arguments]' is the nonOptions() list and MUST be a List if provided.

Example
```
@CommandMethod(command="test", options=true, optionOrder={"[arguments]", "r", "min"}
public void method(OptionSet set, CommandSender sender, List arguments, Double radius, Integer min)
{ .... method body .... }

public void method(OptionParser parser)
{
parser.accepts("r")
.ofType(Double.class);
parser.accepts("min")
.ofType(Integer.class);
}
```

All arguments are checked on registering them to make sure casting will not fail at runtime. Any non-required options specified in the method signature will be null in the method if they are not provided. Any options not in the method signature can still be accessed via the OptionSet. Defaults to empty array making the only required parameters OptionSet and CommandSender

**Sender Restriction**

Adds allowedSenders to the annotation which allows you to specify which command senders are allowed to trigger the command. Also allows you to change the method signature as long as the class chosen is a superclass of all the allowed ones. Defaults to CommandSender to allow all.