Class ParsingContext<C>

java.lang.Object
org.incendo.cloud.context.ParsingContext<C>

@API(status=MAINTAINED) public final class ParsingContext<C> extends Object
  • Constructor Details

  • Method Details

    • component

      public @NonNull CommandComponent<C> component()
      Return the associated component.
      Returns:
      the component
    • parseDuration

      public @NonNull Duration parseDuration()
      Return the duration taken to parse the component.
      Returns:
      the argument parse duration
    • markStart

      @API(status=INTERNAL, consumers="org.incendo.cloud.*") public void markStart()
      Set the start time.
    • markEnd

      @API(status=INTERNAL, consumers="org.incendo.cloud.*") public void markEnd()
      Set the end time.
    • success

      public boolean success()
      Return whether the argument was parsed successfully.
      Returns:
      true if the value was parsed successfully, false if not
    • success

      @API(status=INTERNAL, consumers="org.incendo.cloud.*") public void success(boolean success)
      Set whether the argument was parsed successfully.
      Parameters:
      success - true if the value was parsed successfully, false if 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 input
      postParse - post-parse input
    • consumedInput

      @API(status=STABLE) public @NonNull String consumedInput()
      Returns the consumed input.
      Returns:
      the consumed input
    • exactAlias

      public @Nullable String exactAlias()
      Return the exact alias used, if the argument was static. If no alias was consumed then null is returned.
      Returns:
      the exact alias, or null
    • consumedFrom

      @API(status=STABLE) public int consumedFrom()
      Index the parser consumed from.
      Returns:
      consumed from index
    • consumedTo

      @API(status=STABLE) public int consumedTo()
      Index the parser consumed to.
      Returns:
      consumed to index