TextTransformerRegistry Class

Namespace
Kampute.DocToolkit.Formatters
Assembly
  • Kampute.DocToolkit.dll

Definition

Provides a registry for text transformers that convert content from different formats to a target format.
public class TextTransformerRegistry
Inheritance

Remarks

The TextTransformerRegistry class manages a collection of text transformers for converting content from various source formats to a target format. Each transformer is registered with one or more file extensions that it can handle as input.
By default, the target file extension is registered with the IdentityTransformer. This means that if no other transformer is registered for the target file extension, the content will be passed through unchanged. It is possible to override this default behavior by registering a different transformer for the target file extension. However, removing the target file extension from the registry is not allowed.

Thread Safety

All public members of the type are guaranteed to be thread-safe.

Constructors

TextTransformerRegistry(string)Initializes a new instance of the TextTransformerRegistry class.

Properties

SupportedFileExtensionsGets the file extensions that can be transformed to the target format.
TargetFileExtensionGets the file extension of the target format.

Methods

CanTransform(string)Determines if a text transformer is available for the specified file extension.
IsTargetFileExtension(string)Determines if the specified file extension is the target file extension.
Register<TTransformer>(IEnumerable<string>)Registers a text transformer for for one or more file extensions.
Register(ITextTransformer, IEnumerable<string>)Registers a text transformer for one or more file extensions.
Remove<TTransformer>()Removes all registered transformers of the specified type.
Remove(string)Removes a registered transformer for the specified file extension.
TryGet(string, out ITextTransformer)Attempts to get a text transformer for the specified file extension.

See Also