ParserPluginRegistry class
Registry for managing parser plugins
The registry maintains a collection of plugins and provides methods to query them efficiently.
Example usage:
final registry = ParserPluginRegistry();
registry.register(MentionPlugin());
registry.register(EmojiPlugin());
// Use with MarkdownParser
final parser = MarkdownParser(plugins: registry);
Constructors
- ParserPluginRegistry()
- Creates a new plugin registry
Properties
-
blockPlugins
→ List<
BlockParserPlugin> -
All registered block plugins, sorted by priority (descending)
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inlinePlugins
→ List<
InlineParserPlugin> -
All registered inline plugins, sorted by priority (descending)
no setter
-
inlineTriggerCharacters
→ Set<
String> -
Set of all inline trigger characters
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Clears all registered plugins
-
copy(
) → ParserPluginRegistry - Creates a copy of this registry
-
findBlockPlugins(
String line, List< String> lines, int index) → Iterable<BlockParserPlugin> - Finds block plugins that can parse the given line
-
findInlinePlugins(
String text, int index) → Iterable< InlineParserPlugin> - Finds inline plugins that can parse at the given position
-
getBlockPlugin(
String id) → BlockParserPlugin? - Gets a block plugin by ID
-
getInlinePlugin(
String id) → InlineParserPlugin? - Gets an inline plugin by ID
-
getInlinePluginByTrigger(
String char) → InlineParserPlugin? - Gets an inline plugin by trigger character
-
isInlineTrigger(
String char) → bool - Checks if a character is a trigger for any inline plugin
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
ParserPlugin plugin) → void - Registers a plugin (automatically determines type)
-
registerAll(
Iterable< ParserPlugin> plugins) → void - Registers multiple plugins at once
-
registerBlock(
BlockParserPlugin plugin) → void - Registers a block parser plugin
-
registerInline(
InlineParserPlugin plugin) → void - Registers an inline parser plugin
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterBlock(
String id) → bool - Unregisters a block plugin by ID
-
unregisterInline(
String id) → bool - Unregisters an inline plugin by ID
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited