org.apache.uima.fit.descriptor

## Annotation Type SofaCapability

-     @Retention(value=RUNTIME)
       @Target(value=TYPE)
      public @interface SofaCapability

        @SofaCapability(inputSofas = { GOLD_VIEW, SYSTEM_VIEW })

  or

        @SofaCapability(inputSofas = CAS.NAME_DEFAULT_SOFA, outputSofas = GOLD_VIEW)

  Adding this annotation to your analysis engine description makes your component "sofa aware." The base CAS delivered to "sofa aware" components has no explicit view associated with it. The logic is that it is impossible to know the intent of a sofa aware component and it should use getView as needed. You should therefore be aware that if you need to work with the "_InitialView" view, then you must explicitly request it with a call like:

       JCas initialView = jCas.getView(CAS.NAME_DEFAULT_SOFA);

  This is because the base CAS that it passed into the process method to "sofa aware" components is not the same as the "_InitialView". See how the following member variable is used to understand why/how:

       org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.mSofaAware

- - ### Field Summary

    Fields
    Modifier and Type | Fields and Description
    --- | ---
    `static String` | `NO_DEFAULT_VALUE` Provides the default value for the inputs and the outputs that tells the CapabilityFactory that no value has been given to the inputs or outputs elements.

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String[]` | `inputSofas` The values should be string vales corresponding to view names such as e.g.
    `String[]` | `outputSofas` The values should be string vales corresponding to view names that this analysis component will create.

- - ### Field Detail

    - #### NO_DEFAULT_VALUE

          public static final String NO_DEFAULT_VALUE

      Provides the default value for the inputs and the outputs that tells the CapabilityFactory that no value has been given to the inputs or outputs elements.

  - ### Element Detail

    - #### inputSofas

          public abstract String[] inputSofas

      The values should be string vales corresponding to view names such as e.g. CAS.NAME_DEFAULT_SOFA that this analysis component expects to be present in the CAS.
      Returns:
        the input sofas
      Default:
        "org.apache.uima.fit.descriptor.SofaCapability.NO_DEFAULT_VALUE"

  - - #### outputSofas

          public abstract String[] outputSofas

      The values should be string vales corresponding to view names that this analysis component will create.
      Returns:
        the output sofas
      Default:
        "org.apache.uima.fit.descriptor.SofaCapability.NO_DEFAULT_VALUE"

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