Class Annotator_ImplBase

java.lang.Object
org.apache.uima.analysis_component.AnalysisComponent_ImplBase
org.apache.uima.analysis_component.Annotator_ImplBase
All Implemented Interfaces:
AnalysisComponent
Direct Known Subclasses:
CasAnnotator_ImplBase, JCasAnnotator_ImplBase

public abstract class Annotator_ImplBase extends AnalysisComponent_ImplBase
Base class for all annotators. An Annotator is an AnalysisComponent that may modify its input CAS, but never creates any new CASes as output. Typically, annotators should not extend this class directly, but instead extend CasAnnotator_ImplBase or JCasAnnotator_ImplBase depending on which CAS interface they wish to use.
  • Constructor Details

    • Annotator_ImplBase

      public Annotator_ImplBase()
  • Method Details

    • getCasInstancesRequired

      public final int getCasInstancesRequired()
      Returns 0, since annotators are not allowed to create new CAS instances. Only CasMultipliers are allowed to do this.
      Returns:
      the number of CAS instances required by this AnalysisComponent.
    • hasNext

      public final boolean hasNext() throws AnalysisEngineProcessException
      Returns false, since annotators are not allowed to create new CAS instances. Only CasMultipliers are allowed to do this.
      Returns:
      true if this AnalysisComponent has another CAS to output, false if not.
      Throws:
      AnalysisEngineProcessException - if a problem occurs during processing
    • next

      public final AbstractCas next() throws AnalysisEngineProcessException
      Throws a UIMA_IllegalStateException, since annotators are not allowed to create new CAS instances. Only CasMultipliers are allowed to do this.
      Returns:
      the next output CAS.
      Throws:
      AnalysisEngineProcessException - if a problem occurs during processing