org.eclipse.ocl.uml
Class TypeResolverImpl

java.lang.Object
  extended by org.eclipse.ocl.AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
      extended by org.eclipse.ocl.uml.TypeResolverImpl
All Implemented Interfaces:
TypeResolver<Classifier,Operation,Property>

public class TypeResolverImpl
extends AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>

UML implementation of the TypeResolver interface.


Field Summary
 
Fields inherited from class org.eclipse.ocl.AbstractTypeResolver
ADDITIONS_PACKAGE, COLLECTIONS_PACKAGE, MESSAGES_PACKAGE, TUPLES_PACKAGE, TYPES_PACKAGE
 
Constructor Summary
TypeResolverImpl(UMLEnvironment env)
          Initializes me with an Environment.
TypeResolverImpl(UMLEnvironment env, Resource resource)
          Initializes me with a resource in which I will persist the model-based types that I generate in my associated Environment.
 
Method Summary
protected  void addClassifier(Package pkg, Classifier classifier)
          Adds a classifier to the specified package, which is one that I use to store OCL-generated types.
protected  void addOperation(Classifier owner, Operation operation)
          Adds the specified operation to a classifier.
protected  void addProperty(Classifier owner, Property property)
          Adds the specified property to a classifier.
protected  Package createPackage(String name)
          Creates a package with the specified name.
protected  Resource createResource()
          Creates the resource that persists my generated types.
protected  Class createShadowClass(Classifier type)
          Creates the shadow class to contain additional features defined for the specified OCL type.
protected  Package findPackage(String name)
          Finds the existing package with the specified name in my resource.
protected  Classifier getShadowedClassifier(Classifier shadow)
          Obtains the classifier for which the specified shadow stores additional features.
 CollectionType<Classifier,Operation> resolveCollectionType(CollectionKind kind, Classifier elementType)
          Resolves the collection type of the specified kind and element type, either created anew or previously created.
 
Methods inherited from class org.eclipse.ocl.AbstractTypeResolver
createAdditionalFeaturesPackage, createCollectionPackage, createCollectionType, createMessagePackage, createOperationMessageType, createSignalMessageType, createTuplePackage, createTupleType, createTypePackage, createTypeType, dispose, findAdditionalFeaturesPackage, findCollectionPackage, findCollectionType, findMatchingOperation, findMatchingProperty, findMessagePackage, findMessageType, findShadowClass, findTuplePackage, findTupleType, findTypePackage, findTypeType, getAdditionalAttributes, getAdditionalFeaturesPackage, getAdditionalOperations, getCollectionPackage, getEnvironment, getMessagePackage, getResource, getShadowClass, getTuplePackage, getTypePackage, hasAdditionalFeatures, resolve, resolveAdditionalAttribute, resolveAdditionalOperation, resolveOperationMessageType, resolveSignalMessageType, resolveTupleType, resolveTypeType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeResolverImpl

public TypeResolverImpl(UMLEnvironment env)
Initializes me with an Environment.

Parameters:
env - my environment

TypeResolverImpl

public TypeResolverImpl(UMLEnvironment env,
                        Resource resource)
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

createResource

protected Resource createResource()
Description copied from class: AbstractTypeResolver
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 the model on which constraints are being parsed, if desired.

Overrides:
createResource in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Returns:
the new resource

createPackage

protected Package createPackage(String name)
Description copied from class: AbstractTypeResolver
Creates a package with the specified name. This puts the new package in an appropriate place in my resource.

Specified by:
createPackage in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
name - the package name
Returns:
the new package, persisted in my resource

findPackage

protected Package findPackage(String name)
Description copied from class: AbstractTypeResolver
Finds the existing package with the specified name in my resource. This will be one of the packages that I would create for storing OCL-generated types.

Specified by:
findPackage in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
name - the package to seek
Returns:
the package, or null if none

addClassifier

protected void addClassifier(Package pkg,
                             Classifier classifier)
Description copied from class: AbstractTypeResolver
Adds a classifier to the specified package, which is one that I use to store OCL-generated types.

Specified by:
addClassifier in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
pkg - one of my packages
classifier - a classifier to add to it

addOperation

protected void addOperation(Classifier owner,
                            Operation operation)
Description copied from class: AbstractTypeResolver
Adds the specified operation to a classifier.

Specified by:
addOperation in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
owner - the classifier to own the operation
operation - the operation to add to the classifier

addProperty

protected void addProperty(Classifier owner,
                           Property property)
Description copied from class: AbstractTypeResolver
Adds the specified property to a classifier.

Specified by:
addProperty in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
owner - the classifier to own the property
property - the property to add to the classifier

createShadowClass

protected Class createShadowClass(Classifier type)
Description copied from class: AbstractTypeResolver
Creates the shadow class to contain additional features defined for the specified OCL type.

Specified by:
createShadowClass in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
type - an OCL type
Returns:
the class containing its additional features

getShadowedClassifier

protected Classifier getShadowedClassifier(Classifier shadow)
Description copied from class: AbstractTypeResolver
Obtains the classifier for which the specified shadow stores additional features.

Specified by:
getShadowedClassifier in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
shadow - a class originally created to shadow a model classifier
Returns:
the model classifier that it supports
See Also:
AbstractTypeResolver.createShadowClass(Object), AbstractTypeResolver.getShadowClass(Object)

resolveCollectionType

public CollectionType<Classifier,Operation> resolveCollectionType(CollectionKind kind,
                                                                  Classifier elementType)
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<Classifier,Operation,Property>
Overrides:
resolveCollectionType in class AbstractTypeResolver<Package,Classifier,Operation,Property,Parameter>
Parameters:
kind - the kind of collection type to create
elementType - the element type
Returns:
the new or existing collection type

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