org.apache.uima.fit.component

## Class ViewCreatorAnnotator

- java.lang.Object
- - org.apache.uima.analysis_component.AnalysisComponent_ImplBase
  - - org.apache.uima.analysis_component.Annotator_ImplBase
    - - org.apache.uima.analysis_component.JCasAnnotator_ImplBase
      - - org.apache.uima.fit.component.JCasAnnotator_ImplBase
        - - org.apache.uima.fit.component.ViewCreatorAnnotator

- All Implemented Interfaces:
    org.apache.uima.analysis_component.AnalysisComponent

      public class ViewCreatorAnnotator
      extends JCasAnnotator_ImplBase

  This annotator can be placed at/near the beginning of a pipeline to ensure that a particular view is created before it is used further downstream. It will create a view for the view name specified by the configuration parameter PARAM_VIEW_NAME if it doesn't exist. One place this is useful is if you are using an annotator that uses the default view and you have mapped the default view into a different view via a sofa mapping. The default view is created automatically - but if you have mapped the default view to some other view, then the view provided to your annotator (when it asks for the default view) will not be created unless you have explicitly created it.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PARAM_VIEW_NAME` The parameter name for the name of the viewed to be created by this annotator

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViewCreatorAnnotator()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.apache.uima.jcas.JCas` | `createViewSafely(org.apache.uima.jcas.JCas aJCas, String aViewName)` Provides a simple call that allows you to safely create a view if it has not been created yet.
    `void` | `process(org.apache.uima.jcas.JCas aJCas)`

    - ### Methods inherited from class org.apache.uima.fit.component.JCasAnnotator_ImplBase

      `getLogger, initialize`

    - ### Methods inherited from class org.apache.uima.analysis_component.JCasAnnotator_ImplBase

      `getRequiredCasInterface, process`

    - ### Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase

      `getCasInstancesRequired, hasNext, next`

    - ### Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase

      `batchProcessComplete, collectionProcessComplete, destroy, getContext, getResultSpecification, reconfigure, setResultSpecification`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PARAM_VIEW_NAME

          public static final String PARAM_VIEW_NAME

      The parameter name for the name of the viewed to be created by this annotator
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ViewCreatorAnnotator

          public ViewCreatorAnnotator()

  - ### Method Detail

    - #### process

          public void process(org.apache.uima.jcas.JCas aJCas)
                       throws org.apache.uima.analysis_engine.AnalysisEngineProcessException

      Specified by:
        `process` in class `org.apache.uima.analysis_component.JCasAnnotator_ImplBase`
      Throws:
        `org.apache.uima.analysis_engine.AnalysisEngineProcessException`

    - #### createViewSafely

          public static org.apache.uima.jcas.JCas createViewSafely(org.apache.uima.jcas.JCas aJCas,
                                                                   String aViewName)
                                                            throws org.apache.uima.analysis_engine.AnalysisEngineProcessException

      Provides a simple call that allows you to safely create a view if it has not been created yet. If the view already exists, it is ok to call this method anyways without worrying about checking for this yet.
      Parameters:
        `aJCas` - the `JCas` to create the view in
        `aViewName` - the name of the new view
      Returns:
        true if the view was created as a result of calling this method. false if the view already existed.
      Throws:
        `org.apache.uima.analysis_engine.AnalysisEngineProcessException` - if the view could not be created or if an existing view with the given name could not be accessed

Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.