## org.eclipse.emf.ocl.parser
Class TypeResolverImpl

    java.lang.Object
      org.eclipse.emf.ocl.parser.TypeResolverImpl

All Implemented Interfaces:
  TypeResolver

Deprecated. Use the `AbstractTypeResolver` class, instead, with the `AbstractEnvironment`.

    @Deprecated
    public class TypeResolverImpl

extends Object
implements TypeResolver

Default implementation of the `TypeResolver` interface, storing the types that it generates in the a resource to support persistence of `OCLExpression`s referencing these types.

It is recommended that clients extend this class to customize resolution of types based on their models, rather than implementing the interface. Simply override the protected `createXyzPackage()` methods to determine where the resolved types are stored and the `resolveXyzType()` methods to create or find types are required.

Constructor Summary
`TypeResolverImpl()` Deprecated. Initializes me.
`TypeResolverImpl(Resource resource)` Deprecated. Initializes me with a resource in which I will persist the model-based types that I generate in my associated `Environment`.

Method Summary
`protected EPackage` `createAdditionalFeaturesPackage()` Deprecated. Creates the package containing the additional operations and properties parsed in my environment.
`protected EPackage` `createCollectionPackage()` Deprecated. Creates the package containing the collection types that I generate.
`protected CollectionType` `createCollectionType(CollectionKind kind, EClassifier elementType)` Deprecated. Creates a new collection type of the specified `kind` and element type, assuming that it does not already exist.
`protected EPackage` `createMessagePackage()` Deprecated. Creates the package containing the message types that I generate.
`protected MessageType` `createMessageType(ENamedElement element)` Deprecated. Creates a new message type for the specified `element`, assuming that it does not already exist.
`protected Resource` `createResource()` Deprecated. Creates the resource that persists my generated types.
`protected EClass` `createShadowClass(EClassifier type)` Deprecated. Creates the shadow class to contain additional features defined for the specified OCL `type`.
`protected EPackage` `createTuplePackage()` Deprecated. Creates the package containing the tuple types that I generate.
`protected TupleType` `createTupleType(List parts)` Deprecated. Creates a new tuple type from the specified `parts`, assuming that it does not already exist.
`protected EPackage` `createTypePackage()` Deprecated. Creates the package containing the type types that I generate.
`protected TypeType` `createTypeType(EClassifier type)` Deprecated. Creates a new type type for the specified `type`, assuming that it does not already exist.
`protected CollectionType` `findCollectionType(CollectionKind kind, EClassifier elementType)` Deprecated. Finds an existing collection type matching the specified `kind` and element type, if any has already been created.
`protected EOperation` `findMatchingOperation(EClass shadow, EOperation operation)` Deprecated. Finds an operation already existing in the specified `shadow` class that matches the specified `operation` signature.
`protected EStructuralFeature` `findMatchingProperty(EClass shadow, EStructuralFeature property)` Deprecated. Finds a property already existing in the specified `shadow` class that matches the specified `property` signature.
`protected MessageType` `findMessageType(ENamedElement element)` Deprecated. Finds an existing message type matching the specified `element`, if any has already been created.
`protected EClass` `findShadowClass(EClassifier type)` Deprecated. Finds the shadow class to contain additional features defined for the specified OCL `type`, if it already exists.
`protected TupleType` `findTupleType(List parts)` Deprecated. Finds an existing tuple type matching the specified `parts`, if any has already been created.
`protected TypeType` `findTypeType(EClassifier type)` Deprecated. Finds an existing type type matching the specified `type`, if any has already been created.
`EPackage` `getAdditionalFeaturesPackage()` Deprecated. Obtains the package containing the additional operations and properties parsed in my environment.
`EPackage` `getCollectionPackage()` Deprecated. Obtains the package containing the collection types that I generate.
`EPackage` `getMessagePackage()` Deprecated. Obtains the package containing the message types that I generate.
`Resource` `getResource()` Deprecated. Obtains the resource in which the types that I generate are stored for persistence.
`EPackage` `getTuplePackage()` Deprecated. Obtains the package containing the tuple types that I generate.
`EPackage` `getTypePackage()` Deprecated. Obtains the package containing the type types that I generate.
`EClassifier` `resolve(EClassifier type)` Deprecated. Resolves the specified `type`, returning my own persistent type instance representing the same OCL type.
`EOperation` `resolveAdditionalOperation(EClassifier owner, EOperation operation)` Deprecated. Resolves the specified "additional operation" defined by the OCL client on the specified `owner` type.
`EStructuralFeature` `resolveAdditionalProperty(EClassifier owner, EStructuralFeature property)` Deprecated. Resolves the specified "additional property" defined by the OCL client on the specified `owner` type.
`CollectionType` `resolveCollectionType(CollectionKind kind, EClassifier elementType)` Deprecated. Resolves the collection type of the specified `kind` and element type, either created anew or previously created.
`MessageType` `resolveMessageType(EClass signal)` Deprecated. Resolves the type for a message expression referencing the specified `signal`.
`MessageType` `resolveMessageType(EOperation operation)` Deprecated. Resolves the type for a message expression referencing the specified `operation`.
`TupleType` `resolveTupleType(List parts)` Deprecated. Resolves the tuple type consisting of the specified `parts`, in no particular order, either created anew or previously created.
`TypeType` `resolveTypeType(EClassifier type)` Deprecated. Resolves the type for a type expression referencing the specified `type`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TypeResolverImpl

    public TypeResolverImpl()

  Deprecated.
  Initializes me. I create my own resource for persistence of model-based types.

### TypeResolverImpl

    public TypeResolverImpl(Resource resource)

  Deprecated.
  Initializes me with a resource in which I will persist the model-based types that I generate in my associated `Environment`.

  Parameters:
    `resource` - my resource

Method Detail

### resolve

    public EClassifier resolve(EClassifier type)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the specified `type`, returning my own persistent type instance representing the same OCL type.

  The `type` may have been newly created by the parser and be a duplicate of a type previously resolved, or it may actually be a type that was previously resolved. In the latter case, the `type` is returned as is. The `null` type is considered to be resolved (i.e., the result is also `null`).

  Usually, this method will delegate to one of the `resolveXyzType()` methods defined by this interface.

  Specified by:
    `resolve` in interface `TypeResolver`
  Parameters:
    `type` - a type to resolve
  Returns:
    the resolved type, or `type` if it is already resolved

### getResource

    public Resource getResource()

  Deprecated.
  Description copied from interface: `TypeResolver`
  Obtains the resource in which the types that I generate are stored for persistence.

  Specified by:
    `getResource` in interface `TypeResolver`
  Returns:
    my resource

### createResource

    protected Resource createResource()

  Deprecated.
  Creates the resource that persists my generated types. Subclasses requiring persistence must override this default implementation, as it creates a resource that does not support persistence and does not have a useful URI. A subclass could even find some other resource, such as that which will store the expressions parsed in this environment.

  Returns:
    the new resource

### getCollectionPackage

    public EPackage getCollectionPackage()

  Deprecated.
  Obtains the package containing the collection types that I generate.

  Returns:
    my collection type package

### createCollectionPackage

    protected EPackage createCollectionPackage()

  Deprecated.
  Creates the package containing the collection types that I generate.

  Returns:
    the new collection type package

### resolveCollectionType

    public CollectionType resolveCollectionType(CollectionKind kind,
                                                EClassifier elementType)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the collection type of the specified `kind` and element type, either created anew or previously created.

  Specified by:
    `resolveCollectionType` in interface `TypeResolver`
  Parameters:
    `kind` - the kind of collection type to create
    `elementType` - the element type
  Returns:
    the new or existing collection type

### createCollectionType

    protected CollectionType createCollectionType(CollectionKind kind,
                                                  EClassifier elementType)

  Deprecated.
  Creates a new collection type of the specified `kind` and element type, assuming that it does not already exist.

  Parameters:
    `kind` - the kind of collection to create
    `elementType` - the collection's element type
  Returns:
    the new collection type

### findCollectionType

    protected CollectionType findCollectionType(CollectionKind kind,
                                                EClassifier elementType)

  Deprecated.
  Finds an existing collection type matching the specified `kind` and element type, if any has already been created.

  Parameters:
    `kind` - the element kind to search for
    `elementType` - the element type to search for
  Returns:
    the existing collection type, or `null` if none found

### getTuplePackage

    public EPackage getTuplePackage()

  Deprecated.
  Obtains the package containing the tuple types that I generate.

  Returns:
    my tuple type package

### createTuplePackage

    protected EPackage createTuplePackage()

  Deprecated.
  Creates the package containing the tuple types that I generate.

  Returns:
    the new tuple type package

### resolveTupleType

    public TupleType resolveTupleType(List parts)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the tuple type consisting of the specified `parts`, in no particular order, either created anew or previously created. The resulting type is uniquely defined by the names and types of its parts, and twp tuple types are considered equal if they have the same number of parts and their parts correspond one-for-one in name and type (order is not significant).

  Specified by:
    `resolveTupleType` in interface `TypeResolver`
  Parameters:
    `parts` - a list of `TypedElement`s defining the name and type of each tuple part. The part names are unique
  Returns:
    the new or existing tuple type

### createTupleType

    protected TupleType createTupleType(List parts)

  Deprecated.
  Creates a new tuple type from the specified `parts`, assuming that it does not already exist.

  Parameters:
    `parts` - the `TypedElement`s describing the tuple parts
  Returns:
    the new tuple type

### findTupleType

    protected TupleType findTupleType(List parts)

  Deprecated.
  Finds an existing tuple type matching the specified `parts`, if any has already been created.

  Parameters:
    `parts` - the `TypedElement`s describing the tuple parts
  Returns:
    the existing tuple type, or `null` if none found

### getTypePackage

    public EPackage getTypePackage()

  Deprecated.
  Obtains the package containing the type types that I generate.

  Returns:
    my type type package

### createTypePackage

    protected EPackage createTypePackage()

  Deprecated.
  Creates the package containing the type types that I generate.

  Returns:
    the new type type package

### resolveTypeType

    public TypeType resolveTypeType(EClassifier type)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the type for a type expression referencing the specified `type`. This is, effectively, the OCL metatype counterpart for the specified model type.

  Specified by:
    `resolveTypeType` in interface `TypeResolver`
  Parameters:
    `type` - a model type
  Returns:
    the new or existing type type

### createTypeType

    protected TypeType createTypeType(EClassifier type)

  Deprecated.
  Creates a new type type for the specified `type`, assuming that it does not already exist.

  Parameters:
    `type` - the referenced model type
  Returns:
    the new type type

### findTypeType

    protected TypeType findTypeType(EClassifier type)

  Deprecated.
  Finds an existing type type matching the specified `type`, if any has already been created.

  Parameters:
    `type` - the referenced model type
  Returns:
    the existing type type, or `null` if none found

### getMessagePackage

    public EPackage getMessagePackage()

  Deprecated.
  Obtains the package containing the message types that I generate.

  Returns:
    my message type package

### createMessagePackage

    protected EPackage createMessagePackage()

  Deprecated.
  Creates the package containing the message types that I generate.

  Returns:
    the new message type package

### resolveMessageType

    public MessageType resolveMessageType(EOperation operation)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the type for a message expression referencing the specified `operation`.

  Specified by:
    `resolveMessageType` in interface `TypeResolver`
  Parameters:
    `operation` - the operation call that the message represents
  Returns:
    the new or existing message type

### resolveMessageType

    public MessageType resolveMessageType(EClass signal)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the type for a message expression referencing the specified `signal`.

  Specified by:
    `resolveMessageType` in interface `TypeResolver`
  Parameters:
    `signal` - the signal send that the message represents
  Returns:
    the new or existing message type

### createMessageType

    protected MessageType createMessageType(ENamedElement element)

  Deprecated.
  Creates a new message type for the specified `element`, assuming that it does not already exist.

  Parameters:
    `element` - the operation or signal referenced by the message type
  Returns:
    the new message type

### findMessageType

    protected MessageType findMessageType(ENamedElement element)

  Deprecated.
  Finds an existing message type matching the specified `element`, if any has already been created.

  Parameters:
    `element` - the referenced model element
  Returns:
    the existing message type, or `null` if none found

### getAdditionalFeaturesPackage

    public EPackage getAdditionalFeaturesPackage()

  Deprecated.
  Obtains the package containing the additional operations and properties parsed in my environment.

  Returns:
    my additional features package

### createAdditionalFeaturesPackage

    protected EPackage createAdditionalFeaturesPackage()

  Deprecated.
  Creates the package containing the additional operations and properties parsed in my environment.

  Returns:
    the new additional features package

### resolveAdditionalOperation

    public EOperation resolveAdditionalOperation(EClassifier owner,
                                                 EOperation operation)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the specified "additional operation" defined by the OCL client on the specified `owner` type.

  Specified by:
    `resolveAdditionalOperation` in interface `TypeResolver`
  Parameters:
    `owner` - the type on which the additional operation is defined
    `operation` - the additional operation
  Returns:
    the persistent operation

### findMatchingOperation

    protected EOperation findMatchingOperation(EClass shadow,
                                               EOperation operation)

  Deprecated.
  Finds an operation already existing in the specified `shadow` class that matches the specified `operation` signature.

  Parameters:
    `shadow` - the shadow class to search
    `operation` - the operation to match
  Returns:
    the matching operation, or `null` if not found

### findMatchingProperty

    protected EStructuralFeature findMatchingProperty(EClass shadow,
                                                      EStructuralFeature property)

  Deprecated.
  Finds a property already existing in the specified `shadow` class that matches the specified `property` signature.

  Parameters:
    `shadow` - the shadow class to search
    `property` - the property to match
  Returns:
    the matching operation, or `null` if not found

### resolveAdditionalProperty

    public EStructuralFeature resolveAdditionalProperty(EClassifier owner,
                                                        EStructuralFeature property)

  Deprecated.
  Description copied from interface: `TypeResolver`
  Resolves the specified "additional property" defined by the OCL client on the specified `owner` type.

  Specified by:
    `resolveAdditionalProperty` in interface `TypeResolver`
  Parameters:
    `owner` - the type on which the additional property is defined
    `property` - the additional property
  Returns:
    the persistent property

### createShadowClass

    protected EClass createShadowClass(EClassifier type)

  Deprecated.
  Creates the shadow class to contain additional features defined for the specified OCL `type`.

  Parameters:
    `type` - an OCL type
  Returns:
    the class containing its additional features

### findShadowClass

    protected EClass findShadowClass(EClassifier type)

  Deprecated.
  Finds the shadow class to contain additional features defined for the specified OCL `type`, if it already exists.

  Parameters:
    `type` - an OCL type
  Returns:
    the class containing its additional features, or `null` if not found

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.