Package dev.jorel.commandapi.arguments
Class LiteralArgument
java.lang.Object
dev.jorel.commandapi.AbstractArgumentTree<Argument<String>,Argument<?>,org.bukkit.command.CommandSender>
dev.jorel.commandapi.arguments.AbstractArgument<String,Argument<String>,Argument<?>,org.bukkit.command.CommandSender>
- All Implemented Interfaces:
Literal<Argument<String>>,BukkitExecutable<Argument<String>>,ChainableBuilder<Argument<String>>,PlatformExecutable<Argument<String>,org.bukkit.command.CommandSender>
A pseudo-argument representing a single literal string
- Since:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> -
Constructor Summary
ConstructorsConstructorDescriptionLiteralArgument(String literal) A literal argument.LiteralArgument(String nodeName, String literal) A literal argument. -
Method Summary
Modifier and TypeMethodDescriptionCommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> Returns the literal string represented by this argumentstatic LiteralArgumentA utility method to create a literal argument.static LiteralArgumentA utility method to create a literal argument.static LiteralArgumentA utility method to create a literal argument.static LiteralArgumentA utility method to create a literal argument.<Source> StringparseArgument(com.mojang.brigadier.context.CommandContext<Source> cmdCtx, String key, CommandArguments previousArgs) voidsetExecutor(CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> arg0) Methods inherited from class dev.jorel.commandapi.arguments.AbstractArgument
combineWith, copyPermissionsAndRequirements, getArgumentPermission, getCombinedArguments, getEntityNames, getIncludedSuggestions, getNodeName, getOverriddenSuggestions, getRawType, getRequirements, hasCombinedArguments, includeSuggestions, isListed, isOptional, replaceSuggestions, setListed, setOptional, toString, withPermission, withPermission, withRequirementMethods inherited from class dev.jorel.commandapi.AbstractArgumentTree
thenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.jorel.commandapi.BukkitExecutable
executes, executes, executes, executes, executesCommandBlock, executesCommandBlock, executesCommandBlock, executesCommandBlock, executesConsole, executesConsole, executesConsole, executesConsole, executesEntity, executesEntity, executesEntity, executesEntity, executesFeedbackForwarding, executesFeedbackForwarding, executesFeedbackForwarding, executesFeedbackForwarding, executesNative, executesNative, executesNative, executesNative, executesPlayer, executesPlayer, executesPlayer, executesPlayer, executesProxy, executesProxy, executesProxy, executesProxy, executesRemoteConsole, executesRemoteConsole, executesRemoteConsole, executesRemoteConsoleMethods inherited from interface dev.jorel.commandapi.ChainableBuilder
instanceMethods inherited from interface dev.jorel.commandapi.PlatformExecutable
getExecutor
-
Field Details
-
executor
protected CommandAPIExecutor<org.bukkit.command.CommandSender,AbstractCommandSender<? extends org.bukkit.command.CommandSender>> executor
-
-
Constructor Details
-
LiteralArgument
A literal argument. Only takes one string value which cannot be modified- Parameters:
literal- the string literal that this argument will represent. Also acts as this argument's node name
-
LiteralArgument
-
-
Method Details
-
getPrimitiveType
- Specified by:
getPrimitiveTypein classAbstractArgument<String,Argument<String>, Argument<?>, org.bukkit.command.CommandSender>
-
of
A utility method to create a literal argument. Works as an alternative toliteral(String)To provide easier use of this method you can statically import this:
import static dev.jorel.commandapi.arguments.LiteralArgument.of;- Parameters:
literal- the string literal that this argument will represent- Returns:
- the literal argument created by this method
-
literal
A utility method to create a literal argument. Works as an alternative toof(String)To provide easier use of this method you can statically import this:
import static dev.jorel.commandapi.arguments.LiteralArgument.literal;- Parameters:
literal- the string literal that this argument will represent- Returns:
- the literal argument created by this method
-
of
A utility method to create a literal argument. Works as an alternative toliteral(String, String)To provide easier use of this method you can statically import this:
import static dev.jorel.commandapi.arguments.LiteralArgument.of;- Parameters:
literal- the string literal that this argument will represent- Returns:
- the literal argument created by this method
-
literal
A utility method to create a literal argument. Works as an alternative toof(String, String)To provide easier use of this method you can statically import this:
import static dev.jorel.commandapi.arguments.LiteralArgument.literal;- Parameters:
literal- the string literal that this argument will represent- Returns:
- the literal argument created by this method
-
getLiteral
Returns the literal string represented by this argument- Specified by:
getLiteralin interfaceLiteral<Argument<String>>- Returns:
- the literal string represented by this argument
-
getArgumentType
- Specified by:
getArgumentTypein classAbstractArgument<String,Argument<String>, Argument<?>, org.bukkit.command.CommandSender>
-
getHelpString
- Overrides:
getHelpStringin classAbstractArgument<String,Argument<String>, Argument<?>, org.bukkit.command.CommandSender>
-
parseArgument
public <Source> String parseArgument(com.mojang.brigadier.context.CommandContext<Source> cmdCtx, String key, CommandArguments previousArgs) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parseArgumentin classAbstractArgument<String,Argument<String>, Argument<?>, org.bukkit.command.CommandSender> - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getExecutor
public CommandAPIExecutor<org.bukkit.command.CommandSender,AbstractCommandSender<? extends org.bukkit.command.CommandSender>> getExecutor() -
setExecutor
public void setExecutor(CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> arg0) -
clearExecutors
-