Class UsageRegistrationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
studio.mevera.imperat.exception.UsageRegistrationException
All Implemented Interfaces:
Serializable

public final class UsageRegistrationException extends RuntimeException
Happens when the CommandUsage being registered breaks the rules of a valid usage These rules are defined by the UsageVerifier. you can implement your own UsageVerifier and register it for imperat's config to use by calling ConfigBuilder.usageVerifier(UsageVerifier)

The default UsageVerifier has the following rules: Rule 1: At-MOST, only one greedy CommandParameter is allowed in a CommandUsage Rule 2: The position of a greedy CommandParameter MUST be the LAST.

Note: A greedy argument can be annotated with Greedy or its type is either of [Array, Collection, Map]

See Also:
  • Constructor Details

    • UsageRegistrationException

      public UsageRegistrationException(Command<S> command, CommandUsage<S> usage)
      Constructs a new UsageRegistrationException for the given command and usage that violates the usage rules.
      Type Parameters:
      S - the type of the command source
      Parameters:
      command - the command that contains the invalid usage
      usage - the command usage that violates the rules
      See Also: