Package org.incendo.cloud.syntax
Class StandardCommandSyntaxFormatter.FormattingInstance
java.lang.Object
org.incendo.cloud.syntax.StandardCommandSyntaxFormatter.FormattingInstance
- Enclosing class:
StandardCommandSyntaxFormatter<C>
@API(status=STABLE)
public static class StandardCommandSyntaxFormatter.FormattingInstance
extends Object
Instance that is used when building command syntax
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendAggregate(@NonNull CommandComponent<?> component, @NonNull AggregateParser<?, ?> parser) Append an aggregate component to the syntax stringvoidAppend a blank spacevoidappendFlag(@NonNull CommandFlagParser<?> flagParser) Appends a flag argumentvoidappendLiteral(@NonNull CommandComponent<?> literal) Append a literal to the syntax stringvoidappendName(@NonNull String name) Append an argument namevoidappendOptional(@NonNull CommandComponent<?> argument) Append an optional argumentvoidAppend the pipe (|) charactervoidappendRequired(@NonNull CommandComponent<?> argument) Append a required argumentGet the optional argument prefixGet the optional argument suffixGet the required argument prefixGet the required argument suffixtoString()
-
Constructor Details
-
FormattingInstance
protected FormattingInstance()Create a new formatting instance
-
-
Method Details
-
toString
-
appendLiteral
Append a literal to the syntax string- Parameters:
literal- Literal to append
-
appendAggregate
@API(status=STABLE) public void appendAggregate(@NonNull CommandComponent<?> component, @NonNull AggregateParser<?, ?> parser) Append an aggregate component to the syntax string- Parameters:
component- The component that contained the argumentparser- Compound argument to append
-
appendFlag
Appends a flag argument- Parameters:
flagParser- flag parser
-
appendRequired
Append a required argument- Parameters:
argument- Required argument
-
appendOptional
Append an optional argument- Parameters:
argument- Optional argument
-
appendPipe
public void appendPipe()Append the pipe (|) character -
appendName
Append an argument name- Parameters:
name- Name to append
-
requiredPrefix
Get the required argument prefix- Returns:
- Required argument prefix
-
requiredSuffix
Get the required argument suffix- Returns:
- Required argument suffix
-
optionalPrefix
Get the optional argument prefix- Returns:
- Optional argument prefix
-
optionalSuffix
Get the optional argument suffix- Returns:
- Optional argument suffix
-
appendBlankSpace
public void appendBlankSpace()Append a blank space
-