Package org.apache.uima.cas
Interface TypeSystem
-
- All Superinterfaces:
java.lang.Iterable<Type>
- All Known Subinterfaces:
TypeSystemMgr
- All Known Implementing Classes:
TypeSystemImpl
public interface TypeSystem extends java.lang.Iterable<Type>
The interface to the type system. Used to access information about existing
typesandfeaturesusing their String identifiers.This is almost a pure access interface. Exception: the call to getArrayType actually will create a new Array Type if it doesn't already exist.
Types and features are defined using Component Descriptors, written in XML.
Get the type system from a
CASobject withgetTypeSystem().There are a few methods to list the existing types in a type system. Information about which feature is appropriate for which type is available through the
TypeandFeatureclasses. Implements Iterable to allow iterating over all types
-
-
Field Summary
Fields Modifier and Type Field Description static charFEATURE_SEPARATORThis is the character that separates a type name from a feature name.static charNAMESPACE_SEPARATORThis is the character that separates name spaces.static java.lang.StringPARAM_EXCLUDE_PREBUILT_TYPESAdd this to the additionalParameters map to skip adding the prebuilt types to the type system.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description TypegetArrayType(Type componentType)Get or Create an array type with component typecomponentType.java.util.Vector<Type>getDirectlySubsumedTypes(Type type)Deprecated.UsegetDirectSubtypes(Type)instead.java.util.List<Type>getDirectSubtypes(Type type)Get a List of the types directly subsumed by a given type.FeaturegetFeatureByFullName(java.lang.String featureName)Get a feature object for a given name.java.util.Iterator<Feature>getFeatures()Get a list of features, in no particular order.LowLevelTypeSystemgetLowLevelTypeSystem()Return the low-level view of this type system.TypegetParent(Type type)Get the parent type for input type.java.util.List<Type>getProperlySubsumedTypes(Type type)Return the list of all types subsumed by the input type.TypegetTopType()Get the top type, i.e., the root of the type system.TypegetType(java.lang.String typeName)Get a type object for a given type name.java.util.Iterator<Type>getTypeIterator()Get an iterator over all types, in no particular order.TypeNameSpacegetTypeNameSpace(java.lang.String name)Create a type name space object for the name parameter.booleansubsumes(Type superType, Type subType)Does one type inherit from the other?
-
-
-
Field Detail
-
FEATURE_SEPARATOR
static final char FEATURE_SEPARATOR
This is the character that separates a type name from a feature name. Ex.:uima.cas.Annotation:begin.- See Also:
- Constant Field Values
-
NAMESPACE_SEPARATOR
static final char NAMESPACE_SEPARATOR
This is the character that separates name spaces. Ex.:uima.cas.Annotation- See Also:
- Constant Field Values
-
PARAM_EXCLUDE_PREBUILT_TYPES
static final java.lang.String PARAM_EXCLUDE_PREBUILT_TYPES
Add this to the additionalParameters map to skip adding the prebuilt types to the type system. Used by applicaitons only for backwards compatibility with binary serialization forms requiring exactly matching type systems- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
Type getType(java.lang.String typeName)
Get a type object for a given type name. See documentation on type names.- Parameters:
typeName- The name of the type.- Returns:
- A type object, or
nullif no such type exists.
-
getArrayType
Type getArrayType(Type componentType)
Get or Create an array type with component typecomponentType.- Parameters:
componentType- The type of the elements of the resulting array type. This can be any type, even another array type.- Returns:
- The array type with the corresponding component type. If it doesn't exist, a new TypeImpl_array is created for it.
-
getFeatureByFullName
Feature getFeatureByFullName(java.lang.String featureName)
Get a feature object for a given name. See documentation on feature names.- Parameters:
featureName- The fully qualified name of the feature.- Returns:
- An feature object, or
nullif no such feature exists.
-
getTypeIterator
java.util.Iterator<Type> getTypeIterator()
Get an iterator over all types, in no particular order.- Returns:
- The iterator.
-
getTopType
Type getTopType()
Get the top type, i.e., the root of the type system.- Returns:
- The top type.
-
getDirectlySubsumedTypes
@Deprecated java.util.Vector<Type> getDirectlySubsumedTypes(Type type)
Deprecated.UsegetDirectSubtypes(Type)instead.Get a vector of the types directly subsumed by a given type.- Parameters:
type- The input type.- Returns:
- A vector of the directly subsumed types.
-
getDirectSubtypes
java.util.List<Type> getDirectSubtypes(Type type)
Get a List of the types directly subsumed by a given type.- Parameters:
type- The input type.- Returns:
- A List of the directly subsumed types.
-
getProperlySubsumedTypes
java.util.List<Type> getProperlySubsumedTypes(Type type)
Return the list of all types subsumed by the input type. Note: the list does not include the type itself.- Parameters:
type- Input type.- Returns:
- The list of types subsumed by
type.
-
getParent
Type getParent(Type type)
Get the parent type for input type.- Parameters:
type- The type we want to know the parent of.- Returns:
- The parent type, or
nullfor the top type.
-
subsumes
boolean subsumes(Type superType, Type subType)
Does one type inherit from the other?- Parameters:
superType- Supertype.subType- Subtype.- Returns:
trueiffsubinherits fromsuper.
-
getFeatures
java.util.Iterator<Feature> getFeatures()
Get a list of features, in no particular order.- Returns:
- An iterator over the features.
-
getTypeNameSpace
TypeNameSpace getTypeNameSpace(java.lang.String name)
Create a type name space object for the name parameter.- Parameters:
name- The name of the name space.- Returns:
- A
TypeNameSpaceobject corresponding toname, ornull, ifnameis not a legal type name space identifier.
-
getLowLevelTypeSystem
LowLevelTypeSystem getLowLevelTypeSystem()
Return the low-level view of this type system.- Returns:
- The
LowLevelTypeSystemversion of this type system.
-
-