Eluinhost/pluginframework — pull request #27 by Eluinhost (2014-08-28 11:21:20+00:00)
Title: New command annotation style

Adds a new style for command method annotations

Full example:
```
@CommandMethod(value = "test", helpOption = "h")
@CommandOptions({"a", "z", "teams", "[arguments]"})
@PermissionRestriction(value = {"TEST.PERMISSION.1", "TEST.PERMISSION.2"}, needsAll = false)
@SenderRestriction({Player.class, SubClassPlayer.class})
public void method(OptionSet set, Player player, Double avalue, Location target, List arguments)
{

}

@OptionsMethod
public void method(OptionDeclarer declarer)
{
declarer.accepts("z")
.withOptionalArg()
.required()
.withValuesConvertedBy(new LocationValueConverter());
declarer.accepts("a")
.withRequiredArg()
.ofType(Double.class);
declarer.accepts("teams");
}
```

The above would register a command that can only be ran by a Player or a SubClassPlayer and their subclasses (meaning arg 2 can be 'Player'). It also only allows if they have either the permission TEST.PERMISSION.1 OR TEST.PERMISSION.2 It also switches the help option from ? to h and sets up all of it's options