RdfCodecRegistry class final
Manages registration and discovery of RDF codec plugins.
This registry acts as the central point for codec plugin management, providing a mechanism for plugin registration, discovery, and codec auto-detection. It implements a plugin system that allows the core RDF library to be extended with additional serialization formats.
Example usage:
// Create a registry
final registry = RdfCodecRegistry();
// Register format plugins
registry.registerGraphCodec(const TurtleCodec());
registry.registerGraphCodec(const JsonLdGraphCodec());
// Get a codec for a specific MIME type
final turtleCodec = registry.getGraphCodec('text/turtle');
// Or let the system detect the format
final autoCodec = registry.getGraphCodec(); // Will auto-detect
Constructors
- RdfCodecRegistry()
- Creates a new codec registry
Properties
-
allGraphMimeTypes
→ Set<
String> -
Returns all MIME types supported by all registered codecs
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Clear all registered codecs (mainly for testing)
-
detectGraphCodec(
String content) → RdfGraphCodec? - Detect codec from content when no MIME type is available
-
getAllGraphCodecs(
) → List< RdfGraphCodec> - Retrieves all registered codecs
-
getGraphCodec(
String? mimeType) → RdfGraphCodec - Retrieves a codec instance by MIME type
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerGraphCodec(
RdfGraphCodec codec) → void - Register a new codec with the registry
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited