public interface TypeSystemDescription extends MetaDataObject
MetaDataObject
, which implements
XMLizable
, 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
, and
version
. It is recommended that these properties be set on any type system
that is meant to be shared by (imported by) multiple components.
Modifier and Type | Field and Description |
---|---|
static TypeSystemDescription[] |
EMPTY_TYPE_SYSTEM_DESCRIPTIONS |
Modifier and Type | Method and Description |
---|---|
TypeDescription |
addType(String aTypeName,
String aDescription,
String aSupertypeName)
Adds a Type to this TypeSystem fragment.
|
String |
getDescription()
Gets the description of this Type System.
|
Import[] |
getImports()
Gets the imports declared by this Type System.
|
String |
getName()
Gets the name of this Type System.
|
TypeDescription |
getType(String aTypeName)
Retrieves a Type from this TypeSystem fragment.
|
TypeDescription[] |
getTypes()
Gets descriptions of all Types in this TypeSystem fragment.
|
String |
getVendor()
Gets the vendor of this Type System.
|
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's
types list. |
void |
resolveImports(Collection<String> aAlreadyImportedTypeSystemURLs,
ResourceManager aResourceManager)
Resolves any import declarations in this type system, adding the imported types directly onto
this TypeSystemDescription's
types list. |
void |
resolveImports(ResourceManager aResourceManager)
Resolves any import declarations in this type system, adding the imported types directly onto
this TypeSystemDescription's
types list. |
void |
setDescription(String aDescription)
Sets the description of this Type System.
|
void |
setImports(Import[] aImports)
Sets the imports declared by this Type System.
|
void |
setName(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(String aVendor)
Sets the vendor of this Type System.
|
void |
setVersion(String aVersion)
Sets the version number of this Type System.
|
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
static final TypeSystemDescription[] EMPTY_TYPE_SYSTEM_DESCRIPTIONS
String getName()
void setName(String aName)
aName
- the name of this Type SystemUIMA_UnsupportedOperationException
- if this object is not modifiableString getVersion()
void setVersion(String aVersion)
aVersion
- the version number of this Type System, as a StringUIMA_UnsupportedOperationException
- if this object is not modifiableString getDescription()
void setDescription(String aDescription)
aDescription
- the description of this Type SystemUIMA_UnsupportedOperationException
- if this object is not modifiableString getVendor()
void setVendor(String aVendor)
aVendor
- the vendor of this Type System, as a String, null if none has been specified.UIMA_UnsupportedOperationException
- if this object is not modifiableImport[] getImports()
void setImports(Import[] aImports)
aImports
- an array of imports declared by this type system.TypeDescription[] getTypes()
void setTypes(TypeDescription[] aTypes)
aTypes
- descriptions of all Types in this TypeSystem fragmentTypeDescription addType(String aTypeName, String aDescription, String aSupertypeName)
aTypeName
- name of Type to addaDescription
- verbose description of this TypeaSupertypeName
- name of supertype for the new TypeTypeDescription getType(String aTypeName)
aTypeName
- name of Type to retrievenull
if no such type existsvoid resolveImports() throws InvalidXMLException
types
list. The import elements are then
deleted, so this results in a structure that is equivalent to the imported elements having been
defined locally.InvalidXMLException
- if either the import target does not exist or is invalidvoid resolveImports(ResourceManager aResourceManager) throws InvalidXMLException
types
list. The import elements are then
deleted, so this results in a structure that is equivalent to the imported elements having been
defined locally.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 the
ResourceManager.setDataPath(String)
method.InvalidXMLException
- if either the import target does not exist or is invalidvoid resolveImports(Collection<String> aAlreadyImportedTypeSystemURLs, ResourceManager aResourceManager) throws InvalidXMLException
types
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.
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 the
ResourceManager.setDataPath(String)
method.aAlreadyImportedTypeSystemURLs
- URLs of already imported type systems, so we don't import them again.InvalidXMLException
- if either the import target does not exist or is invalidCopyright © 2006–2017 The Apache Software Foundation. All rights reserved.