org.eclipse.emf.ocl.parser
Interface TypeResolver

All Known Implementing Classes:
TypeResolverImpl

public interface TypeResolver

Definition of a resolver for the dynamically-generated OCL types based on the types in the user model. It is expected that an implementation of this interface will cache types for the duration of the associated Environment and, if serialization of OCLExpressions is required, persist them in a Resource.

This interface is not intended to be implemented directly by clients; use or extend the TypeResolverImpl class, instead.


Method Summary
 org.eclipse.emf.ecore.resource.Resource getResource()
          Obtains the resource in which the types that I generate are stored for persistence.
 org.eclipse.emf.ecore.EClassifier resolve(org.eclipse.emf.ecore.EClassifier type)
          Resolves the specified type, returning my own persistent type instance representing the same OCL type.
 org.eclipse.emf.ecore.EOperation resolveAdditionalOperation(org.eclipse.emf.ecore.EClassifier owner, org.eclipse.emf.ecore.EOperation operation)
          Resolves the specified "additional operation" defined by the OCL client on the specified owner type.
 org.eclipse.emf.ecore.EStructuralFeature resolveAdditionalProperty(org.eclipse.emf.ecore.EClassifier owner, org.eclipse.emf.ecore.EStructuralFeature property)
          Resolves the specified "additional property" defined by the OCL client on the specified owner type.
 CollectionType resolveCollectionType(CollectionKind kind, org.eclipse.emf.ecore.EClassifier elementType)
          Resolves the collection type of the specified kind and element type, either created anew or previously created.
 MessageType resolveMessageType(org.eclipse.emf.ecore.EClass signal)
          Resolves the type for a message expression referencing the specified signal.
 MessageType resolveMessageType(org.eclipse.emf.ecore.EOperation operation)
          Resolves the type for a message expression referencing the specified operation.
 TupleType resolveTupleType(java.util.List parts)
          Resolves the tuple type consisting of the specified parts, in no particular order, either created anew or previously created.
 TypeType resolveTypeType(org.eclipse.emf.ecore.EClassifier type)
          Resolves the type for a type expression referencing the specified type.
 

Method Detail

getResource

public org.eclipse.emf.ecore.resource.Resource getResource()
Obtains the resource in which the types that I generate are stored for persistence.

Returns:
my resource

resolve

public org.eclipse.emf.ecore.EClassifier resolve(org.eclipse.emf.ecore.EClassifier type)
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.

Returns:
the resolved type, or type if it is already resolved
See Also:

resolveCollectionType

public CollectionType resolveCollectionType(CollectionKind kind,
                                            org.eclipse.emf.ecore.EClassifier elementType)
Resolves the collection type of the specified kind and element type, either created anew or previously created.

Parameters:
kind - the kind of collection type to create
elementType - the element type
Returns:
the new or existing collection type

resolveTupleType

public TupleType resolveTupleType(java.util.List parts)
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).

Parameters:
parts - a list of TypedElements defining the name and type of each tuple part. The part names are unique
Returns:
the new or existing tuple type

resolveTypeType

public TypeType resolveTypeType(org.eclipse.emf.ecore.EClassifier type)
Resolves the type for a type expression referencing the specified type. This is, effectively, the OCL metatype counterpart for the specified model type.

Parameters:
type - a model type
Returns:
the new or existing type type

resolveMessageType

public MessageType resolveMessageType(org.eclipse.emf.ecore.EOperation operation)
Resolves the type for a message expression referencing the specified operation.

Parameters:
operation - the operation call that the message represents
Returns:
the new or existing message type

resolveMessageType

public MessageType resolveMessageType(org.eclipse.emf.ecore.EClass signal)
Resolves the type for a message expression referencing the specified signal.

Parameters:
signal - the signal send that the message represents
Returns:
the new or existing message type

resolveAdditionalOperation

public org.eclipse.emf.ecore.EOperation resolveAdditionalOperation(org.eclipse.emf.ecore.EClassifier owner,
                                                                   org.eclipse.emf.ecore.EOperation operation)
Resolves the specified "additional operation" defined by the OCL client on the specified owner type.

Parameters:
owner - the type on which the additional operation is defined
operation - the additional operation
Returns:
the persistent operation

resolveAdditionalProperty

public org.eclipse.emf.ecore.EStructuralFeature resolveAdditionalProperty(org.eclipse.emf.ecore.EClassifier owner,
                                                                          org.eclipse.emf.ecore.EStructuralFeature property)
Resolves the specified "additional property" defined by the OCL client on the specified owner type.

Parameters:
owner - the type on which the additional property is defined
property - the additional property
Returns:
the persistent property

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