A - The actor typepublic interface ErrorContext<A extends CommandActor>
For example, if the error was because a parameter was invalid, this
will be a ErrorContext.ParsingParameter context,
which contains information about the parameter being parsed.
If, however, it occurred during executing the command function,
this will be an ErrorContext.ExecutingFunction context.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ErrorContext.ExecutingFunction<A extends CommandActor>
Represents the context for an error that occurred during executing
a command function
|
static interface |
ErrorContext.ParsingLiteral<A extends CommandActor>
Represents the context for an error that occurred during parsing
a literal node
|
static interface |
ErrorContext.ParsingParameter<A extends CommandActor>
Represents the context for an error that occurred during parsing
a parameter node
|
static interface |
ErrorContext.UnknownCommand<A extends CommandActor>
Represents the context for an error due to an unknown command.
|
static interface |
ErrorContext.UnknownParameter<A extends CommandActor>
Represents the context for an error due to an unknown parameter.
|
| Modifier and Type | Method and Description |
|---|---|
A |
actor()
Returns the actor
|
ExecutionContext<A> |
context()
Returns the
ExecutionContext in this context. |
static <A extends CommandActor> |
executingFunction(@NotNull ExecutionContext<A> context)
Creates an
ErrorContext.ExecutingFunction error context |
default boolean |
hasExecutionContext()
Tests whether this context has a
ExecutionContext or not. |
default boolean |
isExecutingFunction()
Tests whether the error occurred during executing a function
|
default boolean |
isParsingLiteral()
Tests whether the error occurred during parsing a literal
|
default boolean |
isParsingParameter()
Tests whether the error occurred during parsing a parameter
|
@NotNull Lamp<A> |
lamp()
Returns the Lamp instance
|
static <A extends CommandActor> |
parsingLiteral(@NotNull ExecutionContext<A> context,
@NotNull LiteralNode<A> node)
Creates a
ErrorContext.ParsingLiteral context for the given literal node |
static <A extends CommandActor> |
parsingParameter(@NotNull ExecutionContext<A> context,
@NotNull ParameterNode<A,?> node,
@NotNull StringStream input)
Creates a
ErrorContext.ParsingParameter context for the given parameter node |
static <A extends CommandActor> |
unknownCommand(A actor)
Creates an
ErrorContext.UnknownCommand error context |
static <A extends CommandActor> |
unknownParameter(@NotNull ExecutionContext<A> context)
Creates an
ErrorContext.UnknownParameter error context |
@NotNull static <A extends CommandActor> @NotNull ErrorContext.ParsingLiteral<A> parsingLiteral(@NotNull @NotNull ExecutionContext<A> context, @NotNull @NotNull LiteralNode<A> node)
ErrorContext.ParsingLiteral context for the given literal nodeA - The actor typenode - The literal node@NotNull static <A extends CommandActor> @NotNull ErrorContext.ParsingParameter<A> parsingParameter(@NotNull @NotNull ExecutionContext<A> context, @NotNull @NotNull ParameterNode<A,?> node, @NotNull @NotNull StringStream input)
ErrorContext.ParsingParameter context for the given parameter nodeA - The actor typenode - The parameter nodeinput - The problematic input@NotNull static <A extends CommandActor> @NotNull ErrorContext.ExecutingFunction<A> executingFunction(@NotNull @NotNull ExecutionContext<A> context)
ErrorContext.ExecutingFunction error contextA - The actor type@NotNull static <A extends CommandActor> @NotNull ErrorContext.UnknownCommand<A> unknownCommand(@NotNull A actor)
ErrorContext.UnknownCommand error contextA - The actor type@NotNull static <A extends CommandActor> @NotNull ErrorContext.UnknownParameter<A> unknownParameter(@NotNull @NotNull ExecutionContext<A> context)
ErrorContext.UnknownParameter error contextA - The actor typedefault boolean hasExecutionContext()
ExecutionContext or not.
All error contexts have an ExecutionContext except ErrorContext.UnknownCommand,
which has no command to wrap (it's unknown)
ExecutionContextExecutionContext<A> context()
ExecutionContext in this context.
All error contexts have an ExecutionContext except ErrorContext.UnknownCommand,
which has no command to wrap (it's unknown)
ExecutionContext or null if there's none@NotNull A actor()
default boolean isParsingLiteral()
default boolean isParsingParameter()
default boolean isExecutingFunction()