Package org.incendo.cloud.context
Class ParsingContext<C>
java.lang.Object
org.incendo.cloud.context.ParsingContext<C>
-
Constructor Summary
ConstructorsConstructorDescriptionParsingContext(@NonNull CommandComponent<@NonNull C> component) Construct an ParsingContext object with the given argument. -
Method Summary
Modifier and TypeMethodDescriptionReturn the associated component.intIndex the parser consumed from.Returns the consumed input.voidconsumedInput(@NonNull CommandInput original, @NonNull CommandInput postParse) Store information about consumed input post-parsing.intIndex the parser consumed to.Return the exact alias used, if the argument was static.voidmarkEnd()Set the end time.voidSet the start time.Return the duration taken to parse the component.booleansuccess()Return whether the argument was parsed successfully.voidsuccess(boolean success) Set whether the argument was parsed successfully.
-
Constructor Details
-
Method Details
-
component
Return the associated component.- Returns:
- the component
-
parseDuration
Return the duration taken to parse the component.- Returns:
- the argument parse duration
-
markStart
Set the start time. -
markEnd
Set the end time. -
success
public boolean success()Return whether the argument was parsed successfully.- Returns:
trueif the value was parsed successfully,falseif not
-
success
Set whether the argument was parsed successfully.- Parameters:
success-trueif the value was parsed successfully,falseif not
-
consumedInput
@API(status=INTERNAL, consumers="org.incendo.cloud.*") public void consumedInput(@NonNull CommandInput original, @NonNull CommandInput postParse) Store information about consumed input post-parsing.- Parameters:
original- pre-parse inputpostParse- post-parse input
-
consumedInput
Returns the consumed input.- Returns:
- the consumed input
-
exactAlias
Return the exact alias used, if the argument was static. If no alias was consumed thennullis returned.- Returns:
- the exact alias, or
null
-
consumedFrom
Index the parser consumed from.- Returns:
- consumed from index
-
consumedTo
Index the parser consumed to.- Returns:
- consumed to index
-