Interface TypeSystemDescription
-
- All Superinterfaces:
java.lang.Cloneable
,MetaDataObject
,java.io.Serializable
,XMLizable
- All Known Implementing Classes:
TypeSystemDescription_impl
public interface TypeSystemDescription extends MetaDataObject
Description of a CAS TypeSystem. This implementsMetaDataObject
, which implementsXMLizable
, so it can be serialized to and deserialized from an XML element.Type systems can declare that they
import
other type systems. At runtime, these imports will be resolved to create a single logical type system.Note that type system imports are not automatically resolved when a TypeSytemDescription is deserialized from XML. To resolve the imports, call the
resolveImports()
method. Import resolution is done automatically when a CAS is created using a TypeSystemDescription.Type systems can optionally be assigned a
name
,description
,vendor
, andversion
. It is recommended that these properties be set on any type system that is meant to be shared by (imported by) multiple components.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeSystemDescription[]
EMPTY_TYPE_SYSTEM_DESCRIPTIONS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeDescription
addType(java.lang.String aTypeName, java.lang.String aDescription, java.lang.String aSupertypeName)
Adds a Type to this TypeSystem fragment.java.lang.String
getDescription()
Gets the description of this Type System.Import[]
getImports()
Gets the imports declared by this Type System.java.lang.String
getName()
Gets the name of this Type System.TypeDescription
getType(java.lang.String aTypeName)
Retrieves a Type from this TypeSystem fragment.TypeDescription[]
getTypes()
Gets descriptions of all Types in this TypeSystem fragment.java.lang.String
getVendor()
Gets the vendor of this Type System.java.lang.String
getVersion()
Gets the version number of this Type System.void
resolveImports()
Resolves any import declarations in this type system, adding the imported types directly onto this TypeSystemDescription'stypes
list.void
resolveImports(java.util.Collection<java.lang.String> aAlreadyImportedTypeSystemURLs, ResourceManager aResourceManager)
Resolves any import declarations in this type system, adding the imported types directly onto this TypeSystemDescription'stypes
list.void
resolveImports(ResourceManager aResourceManager)
Resolves any import declarations in this type system, adding the imported types directly onto this TypeSystemDescription'stypes
list.void
setDescription(java.lang.String aDescription)
Sets the description of this Type System.void
setImports(Import[] aImports)
Sets the imports declared by this Type System.void
setName(java.lang.String aName)
Sets the name of this Type System.void
setTypes(TypeDescription[] aTypes)
Sets the descriptions of all Types in this TypeSystem fragment.void
setVendor(java.lang.String aVendor)
Sets the vendor of this Type System.void
setVersion(java.lang.String aVersion)
Sets the version number of this Type System.-
Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl
-
Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
-
-
-
Field Detail
-
EMPTY_TYPE_SYSTEM_DESCRIPTIONS
static final TypeSystemDescription[] EMPTY_TYPE_SYSTEM_DESCRIPTIONS
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this Type System.- Returns:
- the name of this Type System, null if none has been specified.
-
setName
void setName(java.lang.String aName)
Sets the name of this Type System.- Parameters:
aName
- the name of this Type System- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getVersion
java.lang.String getVersion()
Gets the version number of this Type System.- Returns:
- the version number of this Type System, as a String, null if none has been specified.
-
setVersion
void setVersion(java.lang.String aVersion)
Sets the version number of this Type System.- Parameters:
aVersion
- the version number of this Type System, as a String- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getDescription
java.lang.String getDescription()
Gets the description of this Type System.- Returns:
- the description of this Type System, null if none has been specified.
-
setDescription
void setDescription(java.lang.String aDescription)
Sets the description of this Type System.- Parameters:
aDescription
- the description of this Type System- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getVendor
java.lang.String getVendor()
Gets the vendor of this Type System.- Returns:
- the vendor of this Type System, as a String
-
setVendor
void setVendor(java.lang.String aVendor)
Sets the vendor of this Type System.- Parameters:
aVendor
- the vendor of this Type System, as a String, null if none has been specified.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getImports
Import[] getImports()
Gets the imports declared by this Type System.- Returns:
- an array of imports declared by this type system.
-
setImports
void setImports(Import[] aImports)
Sets the imports declared by this Type System.- Parameters:
aImports
- an array of imports declared by this type system.
-
getTypes
TypeDescription[] getTypes()
Gets descriptions of all Types in this TypeSystem fragment.- Returns:
- descriptions of all Types in this TypeSystem fragment
-
setTypes
void setTypes(TypeDescription[] aTypes)
Sets the descriptions of all Types in this TypeSystem fragment.- Parameters:
aTypes
- descriptions of all Types in this TypeSystem fragment
-
addType
TypeDescription addType(java.lang.String aTypeName, java.lang.String aDescription, java.lang.String aSupertypeName)
Adds a Type to this TypeSystem fragment.- Parameters:
aTypeName
- name of Type to addaDescription
- verbose description of this TypeaSupertypeName
- name of supertype for the new Type- Returns:
- description of the new Type
-
getType
TypeDescription getType(java.lang.String aTypeName)
Retrieves a Type from this TypeSystem fragment.- Parameters:
aTypeName
- name of Type to retrieve- Returns:
- the type with the specified name,
null
if no such type exists
-
resolveImports
void resolveImports() throws InvalidXMLException
Resolves any import declarations in this type system, adding the imported types directly onto this TypeSystemDescription'stypes
list. The import elements are then deleted, so this results in a structure that is equivalent to the imported elements having been defined locally.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
resolveImports
void resolveImports(ResourceManager aResourceManager) throws InvalidXMLException
Resolves any import declarations in this type system, adding the imported types directly onto this TypeSystemDescription'stypes
list. The import elements are then deleted, so this results in a structure that is equivalent to the imported elements having been defined locally.- Parameters:
aResourceManager
- the Resource Manager used to locate type systems imported by name. For example, the path in which to locate these type systems can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
resolveImports
void resolveImports(java.util.Collection<java.lang.String> aAlreadyImportedTypeSystemURLs, ResourceManager aResourceManager) throws InvalidXMLException
Resolves any import declarations in this type system, adding the imported types directly onto this TypeSystemDescription'stypes
list. The import elements are then deleted, so this results in a structure that is equivalent to the imported elements having been defined locally.This version is used internally to resolve nested imports.
- Parameters:
aResourceManager
- the Resource Manager used to locate type systems imported by name. For example, the path in which to locate these type systems can be set via theResourceManager.setDataPath(String)
method.aAlreadyImportedTypeSystemURLs
- URLs of already imported type systems, so we don't import them again.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
-