AutoDetectingGraphCodec class final
A specialized codec that auto-detects the format during decoding
This codec implementation automatically detects the appropriate format for decoding based on content inspection, while using a specified default codec for encoding. It works in conjunction with the RdfCodecRegistry to identify the correct format.
This class is primarily used internally by the RDF library when the format is not explicitly specified, but can also be used directly when working with content of unknown format.
- Inheritance
-
- Object
- Codec<
RdfGraph, String> - RdfGraphCodec
- AutoDetectingGraphCodec
Constructors
- AutoDetectingGraphCodec({required RdfGraphCodec defaultCodec, required RdfCodecRegistry registry, RdfGraphEncoderOptions? encoderOptions, RdfGraphDecoderOptions? decoderOptions})
- Creates a new auto-detecting codec
Properties
- decoder → RdfGraphDecoder
-
Returns an auto-detecting decoder
no setteroverride
- encoder → RdfGraphEncoder
-
Returns the default codec's encoder
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inverted
→ Codec<
String, RdfGraph> -
Inverts
this
.no setterinherited - primaryMimeType → String
-
Returns the primary MIME type of the default codec
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supportedMimeTypes
→ Set<
String> -
Returns all MIME types supported by the registry
no setteroverride
Methods
-
canParse(
String content) → bool -
Determines if the content can be parsed by any registered codec
override
-
decode(
String input, {String? documentUrl, RdfGraphDecoderOptions? options}) → RdfGraph -
Decodes a string containing RDF data into an RDF graph
inherited
-
encode(
RdfGraph input, {String? baseUri, RdfGraphEncoderOptions? options}) → String -
Encodes an RDF graph to a string representation in this codec
inherited
-
fuse<
R> (Codec< String, R> other) → Codec<RdfGraph, R> -
Fuses
this
withother
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withOptions(
{RdfGraphEncoderOptions? encoder, RdfGraphDecoderOptions? decoder}) → RdfGraphCodec -
Creates a new instance with the specified options
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited