org.apache.uima.examples.xmi
Class Ecore2UimaTypeSystem

java.lang.Object
  extended by org.apache.uima.examples.xmi.Ecore2UimaTypeSystem

public class Ecore2UimaTypeSystem
extends java.lang.Object

Converts an Ecore model to a UIMA TypeSystemDescription.


Field Summary
static java.lang.String OPTION_CREATE_ANNOTATION_SUBTYPES
          Configures the assignment of supertypes to EClasses that have no declared supertype.
static java.lang.String OPTION_GENERATE_UIMA_LIST_TYPES
          Configures the handling of multi-valued properties in the Ecore model.
 
Constructor Summary
Ecore2UimaTypeSystem()
           
 
Method Summary
static TypeSystemDescription ecore2UimaTypeSystem(Resource aEcoreResource, java.util.Map aOptions)
          Converts an Ecore model to a UIMA TypeSytemDescription.
static TypeSystemDescription ecore2UimaTypeSystem(java.lang.String aEcoreFilePath, java.util.Map aOptions)
          Converts an Ecore model to a UIMA TypeSytemDescription.
static void main(java.lang.String[] args)
          Main program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_GENERATE_UIMA_LIST_TYPES

public static final java.lang.String OPTION_GENERATE_UIMA_LIST_TYPES
Configures the handling of multi-valued properties in the Ecore model. If set to Boolean.FALSE (the default), UIMA array types (e.g. FSArray) will be generated. If set to Boolean.TRUE, UIMA list types (e.g. FSList) will be generated. Note that for primitive types that have no corresponding list type (Byte, Short, Long, Double, and Boolean), array types will always be used.

See Also:
Constant Field Values

OPTION_CREATE_ANNOTATION_SUBTYPES

public static final java.lang.String OPTION_CREATE_ANNOTATION_SUBTYPES
Configures the assignment of supertypes to EClasses that have no declared supertype. If set to Boolean.TRUE (the default), if such an EClass has "begin" and "end" properties of type EInt, the superclass will be set to uima.tcas.Annotation. If set to Boolean.FALSE, all EClasses with no declared supertype will have their supertype set to uima.cas.TOP.

See Also:
Constant Field Values
Constructor Detail

Ecore2UimaTypeSystem

public Ecore2UimaTypeSystem()
Method Detail

ecore2UimaTypeSystem

public static TypeSystemDescription ecore2UimaTypeSystem(java.lang.String aEcoreFilePath,
                                                         java.util.Map aOptions)
                                                  throws java.net.URISyntaxException
Converts an Ecore model to a UIMA TypeSytemDescription.

Parameters:
aEcoreFilePath - file path to a .ecore model file
aOptions - a Map defining options for the conversion. Valid keys for this map are defined as constants on this class.
Returns:
The UIMA TypeSystemDescription corresponding to the Ecore model
Throws:
java.net.URISyntaxException - if there is a problem finding or reading the .ecore file

ecore2UimaTypeSystem

public static TypeSystemDescription ecore2UimaTypeSystem(Resource aEcoreResource,
                                                         java.util.Map aOptions)
                                                  throws java.net.URISyntaxException
Converts an Ecore model to a UIMA TypeSytemDescription.

Parameters:
aEcoreResource - An EMF Resource containing the Ecore model
aOptions - a Map defining options for the conversion. Valid keys for this map are defined as constants on this class.
Returns:
The UIMA TypeSystemDescription corresponding to the Ecore model
Throws:
java.net.URISyntaxException - if there is a problem reading from the resource

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main program. Takes two arguments: the filename of an input .ecore file and the filename of the UIMA TypeSystem file to generate.

Throws:
java.lang.Exception


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.