Class SocialProcessorContext

java.lang.Object
ovh.mythmc.social.api.context.SocialParserContext
ovh.mythmc.social.api.context.SocialProcessorContext
All Implemented Interfaces:
SocialContext

@Experimental public class SocialProcessorContext extends SocialParserContext
Represents a processing-phase context for a social message.

SocialProcessorContext extends SocialParserContext and is used during active message processing. It provides additional state and utilities required while parsers are being executed.

In addition to all parsing context data, this context includes:

See Also:
  • Method Details

    • addAppliedParser

      @Internal public void addAppliedParser(Class<? extends SocialContextualParser> appliedParser)
      Adds a parser class to the list of applied parsers.

      This method is intended for internal use only.

      Parameters:
      appliedParser - the parser class that was executed
    • appliedParsers

      public List<Class<? extends SocialContextualParser>> appliedParsers()
      Returns an immutable copy of all parser classes that have been applied during this processing cycle.
      Returns:
      an unmodifiable list of applied parser classes
    • injectParser

      public void injectParser(@NotNull @NotNull SocialContextualParser parser)
      Adds a parser to the processing queue while parsing is in progress.

      The injected parser will be executed after all currently queued parsers.

      Parameters:
      parser - the parser to inject
    • from

      public static SocialProcessorContext from(SocialParserContext context, TextProcessor processor, ParseExecution execution)
      Creates a SocialProcessorContext from an existing SocialParserContext.

      All base parsing data is copied from the provided context, and the supplied processor and execution are attached.

      Parameters:
      context - the base parser context
      processor - the active text processor
      execution - the current parse execution
      Returns:
      a new processor context instance