Class StreamFactoryRegistry
Registry for object stream factories.
public static class StreamFactoryRegistry
- Inheritance
-
StreamFactoryRegistry
- Inherited Members
Fields
DefaultFormat
The format assumed when the user names none.
public const string DefaultFormat = "opennlp"
Field Value
Methods
GetFactories<T>()
Returns all factories which produce objects of type T,
keyed by format name, in registration order.
public static IReadOnlyDictionary<string, IObjectStreamFactory<T>> GetFactories<T>()
Returns
Type Parameters
T
GetFactory<T>(string?)
Returns the factory which reads the format named formatName
and produces objects of type T, or null when no
such format is registered.
public static IObjectStreamFactory<T>? GetFactory<T>(string? formatName)
Parameters
formatNamestringthe format name; when
null, DefaultFormat is assumed
Returns
Type Parameters
T
RegisterFactory<T>(string, IObjectStreamFactory<T>)
Registers factory, which reads the format named
formatName and instantiates streams producing objects of type
T.
public static bool RegisterFactory<T>(string formatName, IObjectStreamFactory<T> factory)
Parameters
formatNamestringfactoryIObjectStreamFactory<T>
Returns
- bool
trueif the factory was successfully registered
Type Parameters
T
UnregisterFactory<T>(string)
Unregisters the factory which reads the format named
formatName and produces objects of type
T.
public static void UnregisterFactory<T>(string formatName)
Parameters
formatNamestring
Type Parameters
T