org.apache.uima.fit.component

## Class CasDumpWriter

- java.lang.Object
- - org.apache.uima.analysis_component.AnalysisComponent_ImplBase
  - - org.apache.uima.analysis_component.Annotator_ImplBase
    - - org.apache.uima.analysis_component.CasAnnotator_ImplBase
      - - org.apache.uima.fit.component.CasConsumer_ImplBase
        - - org.apache.uima.fit.component.CasDumpWriter

- All Implemented Interfaces:
    AnalysisComponent

      public class CasDumpWriter
      extends CasConsumer_ImplBase

  Dumps CAS content to a text file. This is useful when setting up test cases which contain a reference output to which an actually produced CAS is compared. The format produced by this component is more easily comparable than a XCAS or XMI format.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EXCLUDE_PREFIX` Pattern exclusion prefix.
    `static String` | `INCLUDE_PREFIX` Pattern inclusion prefix.
    `static String` | `PARAM_FEATURE_PATTERNS` Include/exclude features according to the following patterns.
    `static String` | `PARAM_OUTPUT_FILE` Output file.
    `static String` | `PARAM_SORT` Sort increasing by begin, decreasing by end, increasing by name instead of relying on index order.
    `static String` | `PARAM_TYPE_PATTERNS` Include/exclude specified UIMA types in the output.
    `static String` | `PARAM_WRITE_DOCUMENT_META_DATA` Whether to dump the content of the `CAS.getDocumentAnnotation()`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CasDumpWriter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collectionProcessComplete()`
    `void` | `initialize(UimaContext context)`
    `void` | `process(CAS aCAS)`

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

      `getRequiredCasInterface, process, typeSystemInit`

    - ### 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, destroy, getContext, getLogger, getResultSpecification, reconfigure, setResultSpecification`

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

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

- - ### Field Detail

    - #### INCLUDE_PREFIX

          public static final String INCLUDE_PREFIX

      Pattern inclusion prefix.
      See Also:
        Constant Field Values

    - #### EXCLUDE_PREFIX

          public static final String EXCLUDE_PREFIX

      Pattern exclusion prefix.
      See Also:
        Constant Field Values

    - #### PARAM_OUTPUT_FILE

          public static final String PARAM_OUTPUT_FILE

      Output file. If multiple CASes as processed, their contents are concatenated into this file. Mind that a test case using this consumer with multiple CASes requires a reader which produced the CASes always in the same order. When this file is set to "-", the dump does to `System.out` (default).
      See Also:
        Constant Field Values

    - #### PARAM_WRITE_DOCUMENT_META_DATA

          public static final String PARAM_WRITE_DOCUMENT_META_DATA

      Whether to dump the content of the `CAS.getDocumentAnnotation()`.
      See Also:
        Constant Field Values

    - #### PARAM_FEATURE_PATTERNS

          public static final String PARAM_FEATURE_PATTERNS

      Include/exclude features according to the following patterns. Mind that the patterns do not actually match feature names but lines produced by `FeatureStructure.toString()`.
      See Also:
        Constant Field Values

    - #### PARAM_TYPE_PATTERNS

          public static final String PARAM_TYPE_PATTERNS

      Include/exclude specified UIMA types in the output.
      See Also:
        Constant Field Values

    - #### PARAM_SORT

          public static final String PARAM_SORT

      Sort increasing by begin, decreasing by end, increasing by name instead of relying on index order.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CasDumpWriter

          public CasDumpWriter()

  - ### Method Detail

    - #### initialize

          public void initialize(UimaContext context)
                          throws ResourceInitializationException

      Specified by:
        `initialize` in interface `AnalysisComponent`
      Overrides:
        `initialize` in class `CasConsumer_ImplBase`
      Throws:
        `ResourceInitializationException`

    - #### process

          public void process(CAS aCAS)
                       throws AnalysisEngineProcessException

      Specified by:
        `process` in class `CasAnnotator_ImplBase`
      Throws:
        `AnalysisEngineProcessException`

    - #### collectionProcessComplete

          public void collectionProcessComplete()

      Specified by:
        `collectionProcessComplete` in interface `AnalysisComponent`
      Overrides:
        `collectionProcessComplete` in class `AnalysisComponent_ImplBase`

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