Interface TypePriorities
-
- All Superinterfaces:
java.lang.Cloneable
,MetaDataObject
,java.io.Serializable
,XMLizable
- All Known Implementing Classes:
TypePriorities_impl
public interface TypePriorities extends MetaDataObject
A declaration of priorities between CAS Types. Type priority can be a basis for ordering feature structures within an index - seeFsIndexDescription
.This object implements
MetaDataObject
, which implementsXMLizable
, so it can be serialized to and deserialized from an XML element.TypePriorities can declare that they
import
other TypePriorities. At runtime, these imports will be resolved to create a single logical TypePriorities object.Note that type priorities imports are not automatically resolved when a TypePriorities object is deserialized from XML. To resolve the imports, call the
resolveImports()
method. Import resolution is done automatically when a CAS is created using a TypePriorities object.TypePriorities declarations can optionally be assigned a
name
,description
,vendor
, andversion
. It is recommended that these properties be set on any TypePriorities declaration that is meant to be shared by (imported by) multiple components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description TypePriorityList
addPriorityList()
Creates a new, emptyTypePriorityList
and adds it to this object.void
addPriorityList(TypePriorityList aPriorityList)
Adds aTypePriorityList
.java.lang.String
getDescription()
Gets the description of this TypePriorities declaration.Import[]
getImports()
Gets the imports declared by this TypePriorities declaration.java.lang.String
getName()
Gets the name of this TypePriorities declaration.TypePriorityList[]
getPriorityLists()
Gets theTypePriorityList
s that define the priorities.java.lang.String
getVendor()
Gets the vendor of this TypePriorities declaration.java.lang.String
getVersion()
Gets the version number of this TypePriorities declaration.void
removePriorityList(TypePriorityList aPriorityList)
Removes aTypePriorityList
.void
resolveImports()
Resolves any import declarations in this Type Priorities declaration, adding the importedTypePriorityList
objects directly onto this TypePriorities object'spriorityLists
.void
resolveImports(java.util.Collection<java.lang.String> aAlreadyImportedPriorityListURLs, ResourceManager aResourceManager)
Deprecated.Method is deprecated because it should only be used internally.void
resolveImports(ResourceManager aResourceManager)
Resolves any import declarations in this Type Priorities declaration, adding the importedTypePriorityList
objects directly onto this TypePriorities object'spriorityLists
.void
setDescription(java.lang.String aDescription)
Sets the description of this TypePriorities declaration.void
setImports(Import[] aImports)
Sets the imports declared by this TypePriorities declaration.void
setName(java.lang.String aName)
Sets the name of this TypePriorities declaration.void
setPriorityLists(TypePriorityList[] aPriorityLists)
Sets theTypePriorityList
s that define the priorities.void
setVendor(java.lang.String aVendor)
Sets the vendor of this TypePriorities declaration.void
setVersion(java.lang.String aVersion)
Sets the version number of this TypePriorities declaration.-
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
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this TypePriorities declaration.- Returns:
- the name of this TypePriorities declaration, null if none has been specified.
-
setName
void setName(java.lang.String aName)
Sets the name of this TypePriorities declaration.- Parameters:
aName
- the name of this TypePriorities declaration- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getVersion
java.lang.String getVersion()
Gets the version number of this TypePriorities declaration.- Returns:
- the version number of this TypePriorities declaration, as a String, null if none has been specified.
-
setVersion
void setVersion(java.lang.String aVersion)
Sets the version number of this TypePriorities declaration.- Parameters:
aVersion
- the version number of this TypePriorities declaration, as a String- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getDescription
java.lang.String getDescription()
Gets the description of this TypePriorities declaration.- Returns:
- the description of this TypePriorities declaration, null if none has been specified.
-
setDescription
void setDescription(java.lang.String aDescription)
Sets the description of this TypePriorities declaration.- Parameters:
aDescription
- the description of this TypePriorities declaration- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getVendor
java.lang.String getVendor()
Gets the vendor of this TypePriorities declaration.- Returns:
- the vendor of this TypePriorities declaration, as a String
-
setVendor
void setVendor(java.lang.String aVendor)
Sets the vendor of this TypePriorities declaration.- Parameters:
aVendor
- the vendor of this TypePriorities declaration, 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 TypePriorities declaration.- Returns:
- an array of imports declared by this TypePriorities declaration.
-
setImports
void setImports(Import[] aImports)
Sets the imports declared by this TypePriorities declaration.- Parameters:
aImports
- an array of imports declared by this TypePriorities declaration.
-
getPriorityLists
TypePriorityList[] getPriorityLists()
Gets theTypePriorityList
s that define the priorities. EachTypePriorityList
declares the relative priority of two or more types.- Returns:
- the
TypePriorityList
s that define the priorities
-
setPriorityLists
void setPriorityLists(TypePriorityList[] aPriorityLists)
Sets theTypePriorityList
s that define the priorities. EachTypePriorityList
declares the relative priority of two or more types.- Parameters:
aPriorityLists
- theTypePriorityList
s that define the priorities
-
addPriorityList
void addPriorityList(TypePriorityList aPriorityList)
Adds aTypePriorityList
.- Parameters:
aPriorityList
- theTypePriorityList
to add
-
addPriorityList
TypePriorityList addPriorityList()
Creates a new, emptyTypePriorityList
and adds it to this object.- Returns:
- the new
TypePriorityList
, which can be modified by the caller
-
removePriorityList
void removePriorityList(TypePriorityList aPriorityList)
Removes aTypePriorityList
.- Parameters:
aPriorityList
- theTypePriorityList
to remove
-
resolveImports
void resolveImports() throws InvalidXMLException
Resolves any import declarations in this Type Priorities declaration, adding the importedTypePriorityList
objects directly onto this TypePriorities object'spriorityLists
. 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 Priorities declaration, adding the importedTypePriorityList
objects directly onto this TypePriorities object'spriorityLists
. 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 priorities XML files imported by name. For example, the path in which to locate these type priorities XML files can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
resolveImports
@Deprecated void resolveImports(java.util.Collection<java.lang.String> aAlreadyImportedPriorityListURLs, ResourceManager aResourceManager) throws InvalidXMLException
Deprecated.Method is deprecated because it should only be used internally. Scheduled for removal in UIMA 4.0.Resolves any import declarations in this Type Priorities declaration, adding the importedTypePriorityList
objects directly onto this TypePriorities object'spriorityLists
. 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:
aAlreadyImportedPriorityListURLs
- URLs of already imported type priorities, so we don't import them again.aResourceManager
- the Resource Manager used to locate type priorities XML files imported by name. For example, the path in which to locate these type priorities XML files can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
-