org.eclipse.ocl.examples.pivot.scoping
Class EnvironmentView
java.lang.Object
org.eclipse.ocl.examples.pivot.scoping.EnvironmentView
public class EnvironmentView
- extends java.lang.Object
An EnvironmentView provides a selective view of the environment visible at
some CST node.
The selection corresponds to an Environment lookup method as defined by the
OCL specification computed in accordance with the the Inherited Attributes.
The selective view is normally for just the single name required by the
lookUp, but may be for all names when a Completion Assist is required.
The EnvironmentView is computed on demand, rather than cached, since only
small parts of the overall environment are needed and caches may not remain
valid for long given the rapid recreation of CST nodes that occurs while
editing.
Method Summary |
boolean |
accepts(org.eclipse.emf.ecore.EClass eClass)
|
void |
addAllContents(Type forType,
ScopeView scopeView,
Type pivotClass,
java.lang.Boolean selectStatic,
java.util.Set<Type> alreadyVisited)
|
void |
addAllProperties(Type type,
java.lang.Boolean selectStatic)
|
protected void |
addAllProperties(Type forType,
Type pivotClass,
java.lang.Boolean selectStatic,
java.util.Set<Type> alreadyVisited)
|
int |
addElement(java.lang.String elementName,
org.eclipse.emf.ecore.EObject element)
Add an element with an elementName to the view |
int |
addElement(java.lang.String elementName,
Type forType,
org.eclipse.emf.ecore.EObject element)
|
int |
addElements(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
|
int |
addElements(Type forType,
java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
|
void |
addElementsOfScope(Element element,
ScopeView scopeView)
|
void |
addFilter(ScopeFilter filter)
|
void |
addImportedElement(org.eclipse.emf.common.util.URI baseURI)
|
void |
addInheritedContents(Class target,
ScopeView scopeView)
|
void |
addLibContents(Type libType,
ScopeView scopeView)
|
int |
addNamedElement(Nameable namedElement)
|
int |
addNamedElement(Type forType,
Nameable namedElement)
|
int |
addNamedElements(java.lang.Iterable<? extends Nameable> namedElements)
|
int |
addNamedElements(Type forType,
java.lang.Iterable<? extends Nameable> namedElements)
|
void |
addRootPackages()
|
int |
computeLookups(Element target,
org.eclipse.emf.ecore.EObject child,
org.eclipse.emf.ecore.EStructuralFeature containmentFeature,
org.eclipse.emf.ecore.EReference targetReference)
|
int |
computeLookups(ScopeView aScope)
|
org.eclipse.emf.ecore.EObject |
getContent()
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
getEntries()
|
MetaModelManager |
getMetaModelManager()
|
java.lang.String |
getName()
|
org.eclipse.emf.ecore.EStructuralFeature |
getReference()
|
org.eclipse.emf.ecore.EClassifier |
getRequiredType()
|
int |
getSize()
|
boolean |
hasFinalResult()
Return true once the EnvironmentView has accumulated sufficient results
to satisfy the lookup criterion for which it was created. |
void |
removeFilter(ScopeFilter filter)
|
int |
resolveDuplicates()
|
void |
setBindings(org.eclipse.emf.ecore.EObject eObject,
java.util.Map<TemplateParameter,ParameterableElement> bindings)
|
void |
setRequiredType(org.eclipse.emf.ecore.EClassifier requiredType)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
metaModelManager
protected final MetaModelManager metaModelManager
reference
protected final org.eclipse.emf.ecore.EStructuralFeature reference
name
protected final java.lang.String name
EnvironmentView
public EnvironmentView(MetaModelManager metaModelManager,
org.eclipse.emf.ecore.EStructuralFeature reference,
java.lang.String name)
accepts
public boolean accepts(org.eclipse.emf.ecore.EClass eClass)
addAllContents
public void addAllContents(Type forType,
ScopeView scopeView,
Type pivotClass,
java.lang.Boolean selectStatic,
java.util.Set<Type> alreadyVisited)
addAllProperties
public void addAllProperties(Type type,
java.lang.Boolean selectStatic)
addAllProperties
protected void addAllProperties(Type forType,
Type pivotClass,
java.lang.Boolean selectStatic,
java.util.Set<Type> alreadyVisited)
addElement
public int addElement(java.lang.String elementName,
org.eclipse.emf.ecore.EObject element)
- Add an element with an elementName to the view
- Parameters:
elementName
- name of elementelement
- the element
- Returns:
- the number of elements added; 1 if added, 0 if not
addElement
public int addElement(java.lang.String elementName,
Type forType,
org.eclipse.emf.ecore.EObject element)
addElements
public int addElements(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
addElements
public int addElements(Type forType,
java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
addElementsOfScope
public void addElementsOfScope(Element element,
ScopeView scopeView)
addFilter
public void addFilter(ScopeFilter filter)
addImportedElement
public void addImportedElement(org.eclipse.emf.common.util.URI baseURI)
addInheritedContents
public void addInheritedContents(Class target,
ScopeView scopeView)
addLibContents
public void addLibContents(Type libType,
ScopeView scopeView)
addNamedElement
public int addNamedElement(Nameable namedElement)
addNamedElement
public int addNamedElement(Type forType,
Nameable namedElement)
addNamedElements
public int addNamedElements(java.lang.Iterable<? extends Nameable> namedElements)
addNamedElements
public int addNamedElements(Type forType,
java.lang.Iterable<? extends Nameable> namedElements)
addRootPackages
public void addRootPackages()
computeLookups
public int computeLookups(Element target,
org.eclipse.emf.ecore.EObject child,
org.eclipse.emf.ecore.EStructuralFeature containmentFeature,
org.eclipse.emf.ecore.EReference targetReference)
computeLookups
public int computeLookups(ScopeView aScope)
getContent
public org.eclipse.emf.ecore.EObject getContent()
getEntries
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> getEntries()
getName
public java.lang.String getName()
getReference
public org.eclipse.emf.ecore.EStructuralFeature getReference()
getRequiredType
public org.eclipse.emf.ecore.EClassifier getRequiredType()
getSize
public int getSize()
getMetaModelManager
public MetaModelManager getMetaModelManager()
hasFinalResult
public boolean hasFinalResult()
- Return true once the EnvironmentView has accumulated sufficient results
to satisfy the lookup criterion for which it was created. i.e. any result
for a non-null name, all results for a null name.
removeFilter
public void removeFilter(ScopeFilter filter)
resolveDuplicates
public int resolveDuplicates()
setBindings
public void setBindings(org.eclipse.emf.ecore.EObject eObject,
java.util.Map<TemplateParameter,ParameterableElement> bindings)
setRequiredType
public void setRequiredType(org.eclipse.emf.ecore.EClassifier requiredType)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object