Class ContextFactory<S extends Source>
java.lang.Object
studio.mevera.imperat.context.internal.ContextFactory<S>
- Type Parameters:
S-
Represents a way for defining
how the context is created
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContext(@NotNull Imperat<S> imperat, S source, Command<S> command, @NotNull String label, @NotNull ArgumentInput queue) abstract ExecutionContext<S>createExecutionContext(@NotNull Context<S> plainContext, @NotNull CommandPathSearch<S> dispatch) abstract SuggestionContext<S>createSuggestionContext(@NotNull Imperat<S> imperat, S source, @NotNull Command<S> command, @NotNull String label, @NotNull ArgumentInput queue) static <S extends Source>
ContextFactory<S>
-
Constructor Details
-
ContextFactory
protected ContextFactory()
-
-
Method Details
-
defaultFactory
-
createContext
@NotNull public abstract @NotNull Context<S> createContext(@NotNull @NotNull Imperat<S> imperat, @NotNull S source, Command<S> command, @NotNull @NotNull String label, @NotNull @NotNull ArgumentInput queue) - Parameters:
source- the sender/source of this command executioncommand- the command label usedqueue- the args input- Returns:
- new context from the command and args used by
Source
-
createSuggestionContext
public abstract SuggestionContext<S> createSuggestionContext(@NotNull @NotNull Imperat<S> imperat, @NotNull S source, @NotNull @NotNull Command<S> command, @NotNull @NotNull String label, @NotNull @NotNull ArgumentInput queue) - Parameters:
source- the sourcecommand- the commandqueue- the argument input- Returns:
- new context for auto completions with
CompletionArg
-
createExecutionContext
public abstract ExecutionContext<S> createExecutionContext(@NotNull @NotNull Context<S> plainContext, @NotNull @NotNull CommandPathSearch<S> dispatch) - Parameters:
plainContext- the context plaindispatch- the result of a search and dispatch for the properCommandUsage- Returns:
- the context after resolving args into values for later on parsing it into the execution
-