Package ovh.mythmc.social.api.context
Class SocialProcessorContext
java.lang.Object
ovh.mythmc.social.api.context.SocialParserContext
ovh.mythmc.social.api.context.SocialProcessorContext
- All Implemented Interfaces:
SocialContext
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:
- The active
TextProcessor - The
ParseExecutioncontrolling the current parse lifecycle - A list of applied
parsers
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ovh.mythmc.social.api.context.SocialParserContext
SocialParserContext.Builder<T extends SocialParserContext.Builder<?,?>, R>, SocialParserContext.SocialParserContextBuilder -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAppliedParser(Class<? extends SocialContextualParser> appliedParser) Adds a parser class to the list of applied parsers.List<Class<? extends SocialContextualParser>> Returns an immutable copy of all parser classes that have been applied during this processing cycle.static SocialProcessorContextfrom(SocialParserContext context, TextProcessor processor, ParseExecution execution) Creates aSocialProcessorContextfrom an existingSocialParserContext.voidAdds a parser to the processing queue while parsing is in progress.Methods inherited from class ovh.mythmc.social.api.context.SocialParserContext
builder, getInjectedValue, getInjectedValue, group, injectedValues, injectedValues, injectValue, injectValues
-
Method Details
-
addAppliedParser
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
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
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 aSocialProcessorContextfrom an existingSocialParserContext.All base parsing data is copied from the provided context, and the supplied processor and execution are attached.
- Parameters:
context- the base parser contextprocessor- the active text processorexecution- the current parse execution- Returns:
- a new processor context instance
-