org.eclipse.ocl
Interface Environment.Lookup<PK,C,O,P>

All Known Implementing Classes:
AbstractEnvironment, EcoreEnvironment, UMLEnvironment
Enclosing interface:
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>

public static interface Environment.Lookup<PK,C,O,P>

Optional adapter interface for look-up methods that throw LookupExceptions on abnormal failures (usually ambiguous names).

Since:
1.2

Method Summary
 C tryLookupAssociationClassReference(C owner, String name)
          Finds a reference in the specified class to the named association class.
 C tryLookupClassifier(List<String> names)
          Finds the classifier identified by the specified sequence of names (a qualified name).
 O tryLookupOperation(C owner, String name, List<? extends TypedElement<C>> args)
          Find an operation in the specified class.
 PK tryLookupPackage(List<String> names)
          Finds the package identified by the specified sequence of names (a qualified name).
 P tryLookupProperty(C owner, String name)
          Finds a property defined or inherited by the specified classifier.
 C tryLookupSignal(C owner, String name, List<? extends TypedElement<C>> args)
          Finds a received signal in the specified classifier.
 

Method Detail

tryLookupPackage

PK tryLookupPackage(List<String> names)
                    throws LookupException
Finds the package identified by the specified sequence of names (a qualified name).

Parameters:
names - the qualified name
Returns:
the matching package, or null if not found
Throws:
LookupException - if lookup fails due to an error such as an ambiguity

tryLookupClassifier

C tryLookupClassifier(List<String> names)
                      throws LookupException
Finds the classifier identified by the specified sequence of names (a qualified name).

Parameters:
names - the qualified name
Returns:
the matching classifier, or null if not found
Throws:
LookupException - if lookup fails due to an error such as an ambiguity

tryLookupOperation

O tryLookupOperation(C owner,
                     String name,
                     List<? extends TypedElement<C>> args)
                     throws LookupException
Find an operation in the specified class. Used to resolve operation calls.

Parameters:
owner - the owner type of the called operation, or null to find an implicit owner type (in iteration expressions)
name - the name of the called operation
args - the arguments (expressions or variables) to be matched against the parameter signature of the operation
Returns:
the matching operation, or null if not found
Throws:
LookupException - if lookup fails due to an error such as an ambiguity

tryLookupProperty

P tryLookupProperty(C owner,
                    String name)
                    throws LookupException
Finds a property defined or inherited by the specified classifier.

Parameters:
owner - the owner of the property that we are looking for, or null to find an implicit owner type (in iteration expressions)
name - the property name
Returns:
the property, or null if it could not be found
Throws:
LookupException - if lookup fails due to an error such as an ambiguity

tryLookupAssociationClassReference

C tryLookupAssociationClassReference(C owner,
                                     String name)
                                     throws LookupException
Finds a reference in the specified class to the named association class.

Parameters:
owner - the referencing class to search, or null to find an implicit owner type (in iteration expressions)
name - the association class name (with an initial lower case as per the OCL convention)
Returns:
the association class (generically as a classifier), or null if the specified owner is not at the end of an association with this particular name
Throws:
LookupException - if lookup fails due to an error such as an ambiguity

tryLookupSignal

C tryLookupSignal(C owner,
                  String name,
                  List<? extends TypedElement<C>> args)
                  throws LookupException
Finds a received signal in the specified classifier.

Parameters:
owner - the owner type of the signal reception
name - the name of the signal
args - the arguments (expressions or variables) matching the properties of the signal (parameters of the reception feature)
Returns:
the matching signal, or null if not found
Throws:
LookupException - if lookup fails due to an error such as an ambiguity

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