org.apache.uima.examples.xmi
Class XmiEcoreCasConsumer
java.lang.Object
org.apache.uima.resource.Resource_ImplBase
org.apache.uima.resource.ConfigurableResource_ImplBase
org.apache.uima.collection.CasConsumer_ImplBase
org.apache.uima.examples.xmi.XmiEcoreCasConsumer
- All Implemented Interfaces:
- CasObjectProcessor, CasProcessor, CasConsumer, ConfigurableResource, Resource
public class XmiEcoreCasConsumer
- extends CasConsumer_ImplBase
A variation of the XmiWriterCasConsumer that also saves the Type System to an Ecore file and
links all of the XMI files to it via their schemaLocation attribute. This allows integration with
the Eclipse Modeling Framework (EMF). This class requires the EMF libraries common.jar,
ecore.jar, and ecore.xmi.jar to be in the classpath.
This CAS Consumer takes two parameters:
OutputDirectory
- path to directory into which output files will be written
WriteEcoreTypeSystem
- if true, writes the type system to an Ecore file and
links all of the XMI files to it via their schemaLocation attribute. Requires EMF libraries in
the classpath if this option is set to true.
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_WRITE_ECORE_TYPESYSTEM
|
Method Summary |
void |
initialize()
This method is called during initialization, and does nothing by default. |
void |
processCas(CAS aCAS)
Processes a CAS. |
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_WRITE_ECORE_TYPESYSTEM
public static final java.lang.String PARAM_WRITE_ECORE_TYPESYSTEM
- See Also:
- Constant Field Values
XmiEcoreCasConsumer
public XmiEcoreCasConsumer()
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 a CAS. In this case, the CAS is converted to XMI and written into the output file .
- Parameters:
aCAS
- The CAS to write to XMI
- Throws:
ResourceProcessException
- if there is an error in processing the Resource- See Also:
CasObjectProcessor.processCas(org.apache.uima.cas.CAS)
Copyright © 2012. All Rights Reserved.