Package studio.mevera.imperat.exception
Class UsageRegistrationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
studio.mevera.imperat.exception.UsageRegistrationException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionUsageRegistrationException(Command<S> command, CommandUsage<S> usage) Constructs a new UsageRegistrationException for the given command and usage that violates the usage rules. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UsageRegistrationException
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 usageusage- the command usage that violates the rules- See Also:
-