public interface BaseAnnotator
CasAnnotator_ImplBase
or
JCasAnnotator_ImplBase
.Modifier and Type | Method and Description |
---|---|
void |
destroy()
Frees all resources held by this annotator.
|
void |
initialize(AnnotatorContext aContext)
Performs any startup tasks required by this annotator.
|
void |
reconfigure()
Alerts this annotator that the values of its configuration parameters or external resources
have changed.
|
void |
typeSystemInit(TypeSystem aTypeSystem)
Informs this annotator that the CAS TypeSystem has changed.
|
void initialize(AnnotatorContext aContext) throws AnnotatorInitializationException, AnnotatorConfigurationException
The Analysis Engine supplies this annotator with a reference to the AnnotatorContext
that it will use. This annotator should store a reference to its this object for later use.
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.AnnotatorInitializationException
- if the annotator cannot initialize itself.AnnotatorConfigurationException
- if the configuration specified for this annotator is invalid.void typeSystemInit(TypeSystem aTypeSystem) throws AnnotatorInitializationException, AnnotatorConfigurationException
initialize(AnnotatorContext)
, and will call
it again whenever the CAS TypeSystem changes.
In this method, the Annotator should use the TypeSystem
to resolve the names of Type
and Features to the actual Type
and
Feature
objects, which can then be used during processing.
aTypeSystem
- the new type systemAnnotatorInitializationException
- if the annotator cannot initialize itself.AnnotatorConfigurationException
- if the configuration specified for this annotator is invalid.void reconfigure() throws AnnotatorConfigurationException, AnnotatorInitializationException
It is suggested that annotators implement this efficiently, but it is not required. Annotators
may implement a "dumb" reconfigure by calling destroy
followed by
initialize
and typeSystemInit
.
AnnotatorConfigurationException
- if the configuration specified for this annotator is invalid.AnnotatorInitializationException
- if the annotator fails to reinitialize itself based on the new configuration.void destroy()
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.