org.eclipse.mtl.parser.ast.ocl.environment
Class MTLEnvironment

java.lang.Object
  extended by org.eclipse.ocl.lpg.AbstractBasicEnvironment
      extended by org.eclipse.ocl.AbstractEnvironment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,org.eclipse.ocl.ecore.CallOperationAction,org.eclipse.ocl.ecore.SendSignalAction,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
          extended by org.eclipse.ocl.ecore.EcoreEnvironment
              extended by org.eclipse.mtl.parser.ast.ocl.environment.MTLEnvironment
All Implemented Interfaces:
org.eclipse.ocl.Environment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,org.eclipse.ocl.ecore.CallOperationAction,org.eclipse.ocl.ecore.SendSignalAction,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>, org.eclipse.ocl.Environment.Internal<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,org.eclipse.ocl.ecore.CallOperationAction,org.eclipse.ocl.ecore.SendSignalAction,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>, org.eclipse.ocl.Environment.Lookup<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature>, org.eclipse.ocl.lpg.BasicEnvironment, org.eclipse.ocl.options.Customizable, org.eclipse.ocl.util.Adaptable

public class MTLEnvironment
extends org.eclipse.ocl.ecore.EcoreEnvironment

The environment that will be used throughout the evaluation of MTL templates.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.AbstractEnvironment
org.eclipse.ocl.AbstractEnvironment.VariableEntry
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.Environment
org.eclipse.ocl.Environment.Internal<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>, org.eclipse.ocl.Environment.Lookup<PK,C,O,P>, org.eclipse.ocl.Environment.Registry
 
Field Summary
 
Fields inherited from interface org.eclipse.ocl.Environment
OCL_NAMESPACE_URI, RESULT_VARIABLE_NAME, SELF_VARIABLE_NAME
 
Constructor Summary
protected MTLEnvironment(org.eclipse.emf.ecore.resource.Resource oclEnvironmentResource)
          Delegates instantiation to the super-constructor.
 
Method Summary
 void addHelperOperations(org.eclipse.emf.ecore.EClassifier owner, java.util.List<org.eclipse.emf.ecore.EOperation> operations)
          Convenience method allowing us to add multiple additional operations at once.
 void addMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
          Add a new EPackage in the list of the metamodels considered during the parsing.
 MTLNonStandardLibrary getMTLNonStandardLibrary()
          Returns the MTL non-standard library.
 MTLStandardLibrary getMTLStandardLibrary()
          Returns the MTL standard library.
 java.util.List<org.eclipse.emf.ecore.EClassifier> getTypes()
          Gets the meta-model types of the current module.
 org.eclipse.emf.ecore.EClassifier lookupClassifier(java.util.List<java.lang.String> names)
          
 org.eclipse.emf.ecore.EClassifier lookupClassifier(java.lang.String name)
          Selects the meta-model object for the given name in the current module.
 void removeMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
          Remove a EPackage in the list of the metamodels considered during the parsing.
protected  void setFactory(org.eclipse.ocl.EnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,org.eclipse.ocl.ecore.CallOperationAction,org.eclipse.ocl.ecore.SendSignalAction,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> factory)
          
 
Methods inherited from class org.eclipse.ocl.ecore.EcoreEnvironment
collectStates, createTypeResolver, createTypeResolver, defineAttribute, defineOperation, findPackage, findPackage, getDefinition, getFactory, getOCLFactory, getOCLStandardLibrary, getStates, getTypeResolver, getUMLReflection, isInPostcondition, lookupPackage, setParent, undefine
 
Methods inherited from class org.eclipse.ocl.AbstractEnvironment
addedVariable, addElement, addHelperOperation, addHelperProperty, addOperation, addProperty, deleteElement, dispose, findNonNavigableAssociationEnds, findUnnamedAssociationEnds, getAdditionalAttributes, getAdditionalOperations, getBodyCondition, getContextClassifier, getContextOperation, getContextPackage, getContextProperty, getDeriveConstraint, getInitConstraint, getInternalParent, getResource, getSelfVariable, getVariables, initialLower, isEmpty, lookup, lookupAssociationClassReference, lookupImplicitSourceForAssociationClass, lookupImplicitSourceForOperation, lookupImplicitSourceForProperty, lookupImplicitSourceForSignal, lookupImplicitSourceForState, lookupLocal, lookupOperation, lookupProperty, lookupSignal, lookupState, notOK, removedVariable, setBodyCondition, setContextOperation, setContextPackage, setContextProperty, setDeriveConstraint, setInitConstraint, setInternalParent, setParent, setSelfVariable, tryLookupAssociationClassReference, tryLookupClassifier, tryLookupOperation, tryLookupPackage, tryLookupProperty, tryLookupSignal
 
Methods inherited from class org.eclipse.ocl.lpg.AbstractBasicEnvironment
analyzerError, analyzerError, analyzerError, analyzerWarning, basicGetOptions, clearOptions, createDefaultProblemHandler, getAdapter, getASTMapping, getASTNodeToCSTNodeMap, getFormatter, getOptions, getParser, getProblemHandler, getValue, initASTMapping, isEnabled, lexerError, parserError, problem, putOptions, removeOption, removeOptions, setASTNodeToCSTNodeMap, setOption, setParent, setParser, setProblemHandler, utilityError, validatorError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.lpg.BasicEnvironment
analyzerError, analyzerError, analyzerError, analyzerWarning, getASTMapping, getFormatter, getParser, getProblemHandler, initASTMapping, lexerError, parserError, problem, setParser, setProblemHandler, utilityError, validatorError
 
Methods inherited from interface org.eclipse.ocl.util.Adaptable
getAdapter
 
Methods inherited from interface org.eclipse.ocl.options.Customizable
clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption
 

Constructor Detail

MTLEnvironment

protected MTLEnvironment(org.eclipse.emf.ecore.resource.Resource oclEnvironmentResource)
Delegates instantiation to the super-constructor.

Parameters:
oclEnvironmentResource - resource used to keep the OCL environment.
Method Detail

addMetamodel

public void addMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
Add a new EPackage in the list of the metamodels considered during the parsing.

Parameters:
metamodel - EPackage to add in the current EPackage's known by the parser.

removeMetamodel

public void removeMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
Remove a EPackage in the list of the metamodels considered during the parsing.

Parameters:
metamodel - EPackage to remove in the current EPackage's known by the parser.

lookupClassifier

public org.eclipse.emf.ecore.EClassifier lookupClassifier(java.util.List<java.lang.String> names)

Specified by:
lookupClassifier in interface org.eclipse.ocl.Environment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,org.eclipse.ocl.ecore.CallOperationAction,org.eclipse.ocl.ecore.SendSignalAction,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
Overrides:
lookupClassifier in class org.eclipse.ocl.ecore.EcoreEnvironment
See Also:
EcoreEnvironment.lookupClassifier(java.util.List)

lookupClassifier

public org.eclipse.emf.ecore.EClassifier lookupClassifier(java.lang.String name)
Selects the meta-model object for the given name in the current module.

Parameters:
name - is the name of the type to search
Returns:
the meta-model object, or null if it doesn't exist

getMTLNonStandardLibrary

public MTLNonStandardLibrary getMTLNonStandardLibrary()
Returns the MTL non-standard library.

Returns:
The MTL non-standard library.

getMTLStandardLibrary

public MTLStandardLibrary getMTLStandardLibrary()
Returns the MTL standard library.

Returns:
The MTL standard library.

getTypes

public java.util.List<org.eclipse.emf.ecore.EClassifier> getTypes()
Gets the meta-model types of the current module.

Returns:
the meta-model objects, or an empty list

setFactory

protected void setFactory(org.eclipse.ocl.EnvironmentFactory<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,org.eclipse.ocl.ecore.CallOperationAction,org.eclipse.ocl.ecore.SendSignalAction,org.eclipse.ocl.ecore.Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject> factory)

Overrides:
setFactory in class org.eclipse.ocl.ecore.EcoreEnvironment
See Also:
EcoreEnvironment.setFactory(org.eclipse.ocl.EnvironmentFactory)

addHelperOperations

public void addHelperOperations(org.eclipse.emf.ecore.EClassifier owner,
                                java.util.List<org.eclipse.emf.ecore.EOperation> operations)
Convenience method allowing us to add multiple additional operations at once.

Parameters:
owner - The owner of the added operations.
operations - List of EOperations that are to be added to the environment.

Copyright 2008 Obeo
All Rights Reserved.