Annotation Interface SofaCapability


@Retention(RUNTIME) @Target(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
 
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The values should be string vales corresponding to view names such as e.g.
    The values should be string vales corresponding to view names that this analysis component will create.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    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.
  • Field Details

    • NO_DEFAULT_VALUE

      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.
      See Also:
  • Element Details

    • inputSofas

      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

      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"}