Interface BaseAnnotator
- All Known Subinterfaces:
GenericAnnotator,JTextAnnotator,TextAnnotator
- All Known Implementing Classes:
Annotator_ImplBase,GenericAnnotator_ImplBase,JTextAnnotator_ImplBase
public interface BaseAnnotator
Base interface for annotators in UIMA SDK v1.x. As of v2.0, annotators should extend
CasAnnotator_ImplBase or
JCasAnnotator_ImplBase.-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Frees all resources held by this annotator.voidinitialize(AnnotatorContext aContext) Performs any startup tasks required by this annotator.voidAlerts this annotator that the values of its configuration parameters or external resources have changed.voidtypeSystemInit(TypeSystem aTypeSystem) Informs this annotator that the CAS TypeSystem has changed.
-
Method Details
-
initialize
void initialize(AnnotatorContext aContext) throws AnnotatorInitializationException, AnnotatorConfigurationException Performs any startup tasks required by this annotator. The Analysis Engine calls this method only once, just after an Annotator has been instantiated.The Analysis Engine supplies this annotator with a reference to the
AnnotatorContextthat it will use. This annotator should store a reference to its this object for later use.- Parameters:
aContext- Provides access to external resources that may be used by this annotator. This includes configuration parameters, logging and instrumentation services, and access to external analysis resources.- Throws:
AnnotatorInitializationException- if the annotator cannot initialize itself.AnnotatorConfigurationException- if the configuration specified for this annotator is invalid.
-
typeSystemInit
void typeSystemInit(TypeSystem aTypeSystem) throws AnnotatorInitializationException, AnnotatorConfigurationException Informs this annotator that the CAS TypeSystem has changed. The Analysis Engine calls this method immediately following the call toinitialize(AnnotatorContext), and will call it again whenever the CAS TypeSystem changes.In this method, the Annotator should use the
TypeSystemto resolve the names of Type and Features to the actualTypeandFeatureobjects, which can then be used during processing.- Parameters:
aTypeSystem- the new type system- Throws:
AnnotatorInitializationException- if the annotator cannot initialize itself.AnnotatorConfigurationException- if the configuration specified for this annotator is invalid.
-
reconfigure
Alerts this annotator that the values of its configuration parameters or external resources have changed. This annotator should take appropriate action to reconfigure itself.It is suggested that annotators implement this efficiently, but it is not required. Annotators may implement a "dumb" reconfigure by calling
destroyfollowed byinitializeandtypeSystemInit.- Throws:
AnnotatorConfigurationException- if the configuration specified for this annotator is invalid.AnnotatorInitializationException- if the annotator fails to reinitialize itself based on the new configuration.
-
destroy
void destroy()Frees all resources held by this annotator. The Analysis Engine calls this method only once, when it is finished using this annotator.
-