Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.uima.cas.admin
Interface TypeSystemMgr

All Superinterfaces:
  TypeSystem

    public interface TypeSystemMgr

extends TypeSystem

Writable version of type system.

Field Summary

Fields inherited from interface org.apache.uima.cas.TypeSystem
`FEATURE_SEPARATOR, NAMESPACE_SEPARATOR`

Method Summary
`Feature` | `addFeature(String featureName, Type domainType, Type rangeType)` Add an feature to the type system.
`Feature` | `addFeature(String featureName, Type domainType, Type rangeType, boolean multipleReferencesAllowed)` Add an feature to the type system.
`Type` | `addStringSubtype(String typeName, String[] stringList)` Inherit from String.
`Type` | `addType(String typeName, Type mother)` Add a new type to the type system.
`void` | `commit()` Commit the type system.
`boolean` | `isCommitted()` Check if this instance has been committed.
`void` | `setFeatureFinal(Type type)` Make type feature final in the sense that no new features can be added to this type.
`void` | `setInheritanceFinal(Type type)` Block any further inheritance from this type.

Methods inherited from interface org.apache.uima.cas.TypeSystem
`getArrayType, getDirectlySubsumedTypes, getDirectSubtypes, getFeatureByFullName, getFeatures, getLowLevelTypeSystem, getParent, getProperlySubsumedTypes, getTopType, getType, getTypeIterator, getTypeNameSpace, subsumes`

Method Detail

### addType

    Type addType(String typeName,
                 Type mother)
                 throws CASAdminException

  Add a new type to the type system.

  Parameters:
    `typeName` - The name of the new type.
    `mother` - The type node under which the new type should be attached. This must not be null.
  Returns:
    The new type, or `null` if `typeName` is already in use (so check for null return values).
  Throws:
    `CASAdminException` - If `typeName` is not a legal type name, type system is locked, or `mother` is inheritance final.

### addStringSubtype

    Type addStringSubtype(String typeName,
                          String[] stringList)
                          throws CASAdminException

  Inherit from String. The only way you can inherit from String is by providing a restriction to a set of strings that are possible values for features of this type. This restriction will be checked when such feature values are set. Note that you can not introduce any features on such types, nor can you subtype them any further.

  Parameters:
    `typeName` - The name of the type to be created.
    `stringList` - The list of legal string values for this string type.
  Returns:
    The resulting type, or `null` if the type is already defined.
  Throws:
    `CASAdminException` - If the type system is locked.

### addFeature

    Feature addFeature(String featureName,
                       Type domainType,
                       Type rangeType)
                       throws CASAdminException

  Add an feature to the type system.

  Parameters:
    `featureName` - The name of the new feature.
    `domainType` - The type that defines the domain of the feature.
    `rangeType` - The type that defines the range of the feature.
  Returns:
    The new feature object, or `null` if `featureName` is already in use for `domainType` with the same range (if the range is different, an exception is thrown).
  Throws:
    `CASAdminException` - If `featureName` is not a legal feature name, the type system is locked or `domainType` is feature final. Also if `featureName` has already been defined on `domainType` (or a supertype) with a different range than `rangeType`.

### addFeature

    Feature addFeature(String featureName,
                       Type domainType,
                       Type rangeType,
                       boolean multipleReferencesAllowed)
                       throws CASAdminException

  Add an feature to the type system.

  Parameters:
    `featureName` - The name of the new feature.
    `domainType` - The type that defines the domain of the feature.
    `rangeType` - The type that defines the range of the feature.
    `multipleReferencesAllowed` - If the `rangeType` is an array type, you can use this flag to enforce that the feature value is not referenced anywhere else. This is currently only used for XMI serialization. Defaults to `true`.
  Returns:
    The new feature object, or `null` if `featureName` is already in use for `domainType` with the same range (if the range is different, an exception is thrown).
  Throws:
    `CASAdminException` - If `featureName` is not a legal feature name, the type system is locked or `domainType` is feature final. Also if `featureName` has already been defined on `domainType` (or a supertype) with a different range than `rangeType`.

### commit

    void commit()

  Commit the type system. The type system will be locked and no longer writable. WARNING: Users should not call this, but instead call ((CASImpl) theAssociatedCAS).commitTypeSystem() in order to set up the parts of the CAS that should be set up when the type system is committed.

### isCommitted

    boolean isCommitted()

  Check if this instance has been committed.

  Returns:
    `true` iff this instance has been committed.

### setFeatureFinal

    void setFeatureFinal(Type type)

  Make type feature final in the sense that no new features can be added to this type. Note that making a type feature final automatically makes all ancestors of that type feature final as well.

  Parameters:
    `type` - The type to be made feature final.

### setInheritanceFinal

    void setInheritanceFinal(Type type)

  Block any further inheritance from this type. Does not mean that the type can have no sub-types, just that no new ones can be introduced.

  Parameters:
    `type` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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