org.apache.uima.tools.components
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:
- CasObjectProcessor, CasProcessor, CasConsumer, ConfigurableResource, Resource
public class InlineXmlCasConsumer
- extends 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 |
static java.lang.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. |
static java.lang.String |
PARAM_XCAS
Optional configuration parameter that specifies XCAS output files |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAM_OUTPUTDIR
public static final java.lang.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:
- Constant Field Values
PARAM_XCAS
public static final java.lang.String PARAM_XCAS
- Optional configuration parameter that specifies XCAS output files
- See Also:
- Constant Field Values
InlineXmlCasConsumer
public InlineXmlCasConsumer()
initialize
public void initialize()
throws ResourceInitializationException
- Description copied from class:
CasConsumer_ImplBase
- This method is called during initialization, and does nothing by default. Subclasses should
override it to perform one-time startup logic.
- Overrides:
initialize
in class CasConsumer_ImplBase
- Throws:
ResourceInitializationException
- if a failure occurs during initialization.
processCas
public void processCas(CAS aCAS)
throws 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:
ResourceProcessException
- if there is an error in processing the Resource- See Also:
CasObjectProcessor.processCas(org.apache.uima.cas.CAS)
getDescription
public static CasConsumerDescription getDescription()
throws 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:
InvalidXMLException
- if the descriptor is invalid or missing
getDescriptorURL
public static java.net.URL getDescriptorURL()
Copyright © 2012. All Rights Reserved.