org.apache.uima.test.junit_extension
Class AnnotationWriter
java.lang.Object
org.apache.uima.resource.Resource_ImplBase
org.apache.uima.resource.ConfigurableResource_ImplBase
org.apache.uima.collection.CasConsumer_ImplBase
org.apache.uima.test.junit_extension.AnnotationWriter
- All Implemented Interfaces:
- CasObjectProcessor, CasProcessor, CasConsumer, ConfigurableResource, Resource
public class AnnotationWriter
- extends CasConsumer_ImplBase
- implements CasConsumer
The AnnotationWriter class writes specified annotations to an output file.
The encoding of the output file is UTF-8
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationWriter
public AnnotationWriter()
initialize
public void initialize()
throws ResourceInitializationException
- Initializes this CAS Consumer with the parameters specified in the
descriptor.
- Overrides:
initialize
in class CasConsumer_ImplBase
- Throws:
ResourceInitializationException
- if there is error in
initializing the resources
processCas
public void processCas(CAS aCAS)
throws ResourceProcessException
- Description copied from interface:
CasObjectProcessor
- Process a single CAS.
- Specified by:
processCas
in interface CasObjectProcessor
- Parameters:
aCAS
- the CAS to be processed. Additional information may be added to this CAS (if this CAS
processor is not read-only
).
- Throws:
ResourceProcessException
- if processing fails
batchProcessComplete
public void batchProcessComplete(ProcessTrace aTrace)
throws ResourceProcessException,
java.io.IOException
- Description copied from interface:
CasProcessor
- Completes the processing of a batch. A collection may be divided into one or more batches - it
is up to the CollectionProcessingManager or the application to determine the number and size of
batches.
- Specified by:
batchProcessComplete
in interface CasProcessor
- Overrides:
batchProcessComplete
in class CasConsumer_ImplBase
- Parameters:
aTrace
- an object that records information, such as timing, about this method's execution.
- Throws:
ResourceProcessException
- if an exception occurs during processing
java.io.IOException
- if an I/O failure occurs- See Also:
CasProcessor.batchProcessComplete(org.apache.uima.util.ProcessTrace)
collectionProcessComplete
public void collectionProcessComplete(ProcessTrace aTrace)
throws ResourceProcessException,
java.io.IOException
- Description copied from interface:
CasProcessor
- Completes the processing of an entire collection.
- Specified by:
collectionProcessComplete
in interface CasProcessor
- Overrides:
collectionProcessComplete
in class CasConsumer_ImplBase
- Parameters:
aTrace
- an object that records information, such as timing, about this method's execution.
- Throws:
ResourceProcessException
- if an exception occurs during processing
java.io.IOException
- if an I/O failure occurs- See Also:
CasProcessor.collectionProcessComplete(org.apache.uima.util.ProcessTrace)
reconfigure
public void reconfigure()
throws ResourceConfigurationException
- Description copied from class:
CasConsumer_ImplBase
- Notifies this CAS Consumer that its configuration parameter settings have been changed. By
default this method just calls
CasConsumer_ImplBase.destroy()
followed by CasConsumer_ImplBase.initialize()
. CAS
Consumers that have expensive initialization that does not need to be redone whenever
configuration parameters change may wish to override this method to provide a more efficient
implementation.
- Specified by:
reconfigure
in interface ConfigurableResource
- Overrides:
reconfigure
in class CasConsumer_ImplBase
- Throws:
ResourceConfigurationException
- if the configuration is not valid- See Also:
ConfigurableResource_ImplBase.reconfigure()
destroy
public void destroy()
- Description copied from interface:
Resource
- Releases all resources held by this
Resource
.
- Specified by:
destroy
in interface Resource
- Overrides:
destroy
in class CasConsumer_ImplBase
- See Also:
Resource.destroy()
Copyright © 2012. All Rights Reserved.