Class InlineXmlCasConsumer

java.lang.Object
org.apache.uima.resource.Resource_ImplBase
org.apache.uima.resource.ConfigurableResource_ImplBase
org.apache.uima.collection.CasConsumer_ImplBase
org.apache.uima.tools.components.InlineXmlCasConsumer
All Implemented Interfaces:
org.apache.uima.collection.base_cpm.CasObjectProcessor, org.apache.uima.collection.base_cpm.CasProcessor, org.apache.uima.collection.CasConsumer, org.apache.uima.resource.ConfigurableResource, org.apache.uima.resource.Resource

public class InlineXmlCasConsumer extends org.apache.uima.collection.CasConsumer_ImplBase
A simple CAS consumer that generates inline XML and writes it to a file. UTF-8 encoding is used.

This CAS Consumer takes two parameters:

  • OutputDirectory - path to directory into which output files will be written
  • OutputFilter (optional) - an FSMatchConstraint which annotations must match in order to be included in the output. If omitted, all annotations will be included in the output.

The XML descriptor for this collection reader is stored in the uima-core.jar file as org/apache/uima/util/InlineXmlCasConsumer.xml. It can be accessed via the static method getDescription(), which parses the descirptor and returns a CasConsumerDescription object.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of configuration parameter that must be set to the path of a directory into which the output files will be written.
    static final String
    Optional configuration parameter that specifies XCAS output files

    Fields inherited from interface org.apache.uima.resource.Resource

    PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.uima.collection.CasConsumerDescription
    Parses and returns the descriptor for this collection reader.
    static URL
     
    void
     
    void
    processCas(org.apache.uima.cas.CAS aCAS)
    Processes the CasContainer which was populated by the TextAnalysisEngines.

    Methods inherited from class org.apache.uima.collection.CasConsumer_ImplBase

    batchProcessComplete, collectionProcessComplete, destroy, getProcessingResourceMetaData, initialize, isReadOnly, isStateless, processCas, reconfigure, typeSystemInit

    Methods inherited from class org.apache.uima.resource.ConfigurableResource_ImplBase

    getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue

    Methods inherited from class org.apache.uima.resource.Resource_ImplBase

    getCasManager, getLogger, getMetaData, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, setMetaData, withContextHolder

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.uima.resource.ConfigurableResource

    getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue

    Methods inherited from interface org.apache.uima.resource.Resource

    getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger
  • Field Details

    • PARAM_OUTPUTDIR

      public static final String PARAM_OUTPUTDIR
      Name of configuration parameter that must be set to the path of a directory into which the output files will be written.
      See Also:
    • PARAM_XCAS

      public static final String PARAM_XCAS
      Optional configuration parameter that specifies XCAS output files
      See Also:
  • Constructor Details

    • InlineXmlCasConsumer

      public InlineXmlCasConsumer()
  • Method Details

    • initialize

      public void initialize() throws org.apache.uima.resource.ResourceInitializationException
      Overrides:
      initialize in class org.apache.uima.collection.CasConsumer_ImplBase
      Throws:
      org.apache.uima.resource.ResourceInitializationException
    • processCas

      public void processCas(org.apache.uima.cas.CAS aCAS) throws org.apache.uima.resource.ResourceProcessException
      Processes the CasContainer which was populated by the TextAnalysisEngines.
      In this case, the CAS is converted to XML and written into the output file .
      Parameters:
      aCAS - a CAS which has been populated by the Analysis Engines
      Throws:
      org.apache.uima.resource.ResourceProcessException - if there is an error in processing the Resource
      See Also:
      • CasObjectProcessor.processCas(org.apache.uima.cas.CAS)
    • getDescription

      public static org.apache.uima.collection.CasConsumerDescription getDescription() throws org.apache.uima.util.InvalidXMLException
      Parses and returns the descriptor for this collection reader. The descriptor is stored in the uima.jar file and located using the ClassLoader.
      Returns:
      an object containing all of the information parsed from the descriptor.
      Throws:
      org.apache.uima.util.InvalidXMLException - if the descriptor is invalid or missing
    • getDescriptorURL

      public static URL getDescriptorURL()