Package opennlp.tools.util
Class BaseToolFactory
- java.lang.Object
- 
- opennlp.tools.util.BaseToolFactory
 
- 
- Direct Known Subclasses:
- ChunkerFactory,- DoccatFactory,- LanguageDetectorFactory,- LemmatizerFactory,- POSTaggerFactory,- SentenceDetectorFactory,- TokenizerFactory,- TokenNameFinderFactory
 
 public abstract class BaseToolFactory extends Object Base class for all tool factories. Extensions of this class should:- implement an empty constructor (TODO is it necessary?)
- implement a constructor that takes the ArtifactProviderand callsBaseToolFactory(Map)
- override createArtifactMap()andcreateArtifactSerializersMap()methods if necessary.
 
- 
- 
Constructor SummaryConstructors Constructor Description BaseToolFactory()All sub-classes should have an empty constructor
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static BaseToolFactorycreate(Class<? extends BaseToolFactory> factoryClass, ArtifactProvider artifactProvider)static BaseToolFactorycreate(String subclassName, ArtifactProvider artifactProvider)Map<String,Object>createArtifactMap()Creates aMapwith pairs of keys and objects.Map<String,ArtifactSerializer>createArtifactSerializersMap()Creates aMapwith pairs of keys andArtifactSerializer.Map<String,String>createManifestEntries()Creates the manifest entries that will be added to the model manifestabstract voidvalidateArtifactMap()Validates the parsed artifacts.
 
- 
- 
- 
Method Detail- 
createArtifactSerializersMappublic Map<String,ArtifactSerializer> createArtifactSerializersMap() Creates aMapwith pairs of keys andArtifactSerializer. The models implementation should call this method fromBaseModel#createArtifactSerializersMapThe base implementation will return a HashMapthat should be populated by sub-classes.
 - 
createManifestEntriespublic Map<String,String> createManifestEntries() Creates the manifest entries that will be added to the model manifest- Returns:
- the manifest entries to added to the model manifest
 
 - 
validateArtifactMappublic abstract void validateArtifactMap() throws InvalidFormatExceptionValidates the parsed artifacts. If something is not valid subclasses should throw anInvalidFormatException. Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.- Throws:
- InvalidFormatException
 
 - 
createpublic static BaseToolFactory create(String subclassName, ArtifactProvider artifactProvider) throws InvalidFormatException - Throws:
- InvalidFormatException
 
 - 
createpublic static BaseToolFactory create(Class<? extends BaseToolFactory> factoryClass, ArtifactProvider artifactProvider) throws InvalidFormatException - Throws:
- InvalidFormatException
 
 
- 
 
-