public final class StreamFactoryRegistry extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_FORMAT |
| Modifier and Type | Method and Description |
|---|---|
static <T> Map<String,ObjectStreamFactory<T>> |
getFactories(Class<T> sampleClass)
Returns all factories which produce objects of
sampleClass class. |
static <T> ObjectStreamFactory<T> |
getFactory(Class<T> sampleClass,
String formatName)
Returns a factory which reads format named
formatName and
instantiates streams producing objects of sampleClass class. |
static boolean |
registerFactory(Class sampleClass,
String formatName,
ObjectStreamFactory factory)
Registers
factory which reads format named formatName and
instantiates streams producing objects of sampleClass class. |
static void |
unregisterFactory(Class sampleClass,
String formatName)
Unregisters a factory which reads format named
formatName and
instantiates streams producing objects of sampleClass class. |
public static final String DEFAULT_FORMAT
public static boolean registerFactory(Class sampleClass, String formatName, ObjectStreamFactory factory)
factory which reads format named formatName and
instantiates streams producing objects of sampleClass class.sampleClass - class of the objects, produced by the streams instantiated by the factoryformatName - name of the formatfactory - instance of the factorypublic static void unregisterFactory(Class sampleClass, String formatName)
formatName and
instantiates streams producing objects of sampleClass class.sampleClass - class of the objects, produced by the streams instantiated by the factoryformatName - name of the formatpublic static <T> Map<String,ObjectStreamFactory<T>> getFactories(Class<T> sampleClass)
sampleClass class.sampleClass - class of the objects, produced by the streams instantiated by the factorypublic static <T> ObjectStreamFactory<T> getFactory(Class<T> sampleClass, String formatName)
formatName and
instantiates streams producing objects of sampleClass class.sampleClass - class of the objects, produced by the streams instantiated by the factoryformatName - name of the format, if null, assumes OpenNLP formatCopyright © 2017 The Apache Software Foundation. All rights reserved.