Class ConcreteClassifierDecider
- java.lang.Object
-
- org.emftext.language.java.resolver.decider.AbstractDecider
-
- org.emftext.language.java.resolver.decider.ConcreteClassifierDecider
-
- All Implemented Interfaces:
IResolutionTargetDecider
public class ConcreteClassifierDecider extends AbstractDecider
A decider that looks for concrete classifiers.
-
-
Field Summary
-
Fields inherited from class org.emftext.language.java.resolver.decider.AbstractDecider
active
-
-
Constructor Summary
Constructors Constructor Description ConcreteClassifierDecider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canFindTargetsFor(EObject referenceContainer, EReference crossReference)
Determines if the decider is of any use for the given resolving procedure.boolean
containsCandidates(EObject container, EReference containingReference)
Determines if the decider needs to look into the given reference.EList<? extends EObject>
getAdditionalCandidates(String identifier, EObject container)
Allows for the decider to provide additional target candidates that are not directly contained in the traversed model tree.boolean
isPossibleTarget(String id, EObject element)
Decides if the given element is a (possibly the final) target.void
reset()
Resets the state of the decider before a complete new walk takes place.static EObject
resolveRelativeNamespace(NamespaceAwareElement nsaElement, int idx, EObject startingPoint, EObject referenceContainer, EReference crossReference)
This method assumes that the namespace of the given namespace aware element is relative to the scope given by the starting point element.-
Methods inherited from class org.emftext.language.java.resolver.decider.AbstractDecider
activate, continueAfterReference, deactivate, isActive, isSure, walkInto
-
-
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:IResolutionTargetDecider
Resets the state of the decider before a complete new walk takes place.- Specified by:
reset
in interfaceIResolutionTargetDecider
- Overrides:
reset
in classAbstractDecider
-
containsCandidates
public boolean containsCandidates(EObject container, EReference containingReference)
Description copied from interface:IResolutionTargetDecider
Determines if the decider needs to look into the given reference.- Parameters:
container
-containingReference
-- Returns:
- true for statements lists
-
getAdditionalCandidates
public EList<? extends EObject> getAdditionalCandidates(String identifier, EObject container)
Description copied from interface:IResolutionTargetDecider
Allows for the decider to provide additional target candidates that are not directly contained in the traversed model tree. The additional candidates will be inserted into the scope behind the children of the given container.- Specified by:
getAdditionalCandidates
in interfaceIResolutionTargetDecider
- Overrides:
getAdditionalCandidates
in classAbstractDecider
- Parameters:
identifier
-container
-- Returns:
- inner classifiers (also of super classes) and imported classifiers
-
isPossibleTarget
public boolean isPossibleTarget(String id, EObject element)
Description copied from interface:IResolutionTargetDecider
Decides if the given element is a (possibly the final) target.- Parameters:
id
-element
-- Returns:
- true if the element is a concrete classifier with the correct name
-
canFindTargetsFor
public boolean canFindTargetsFor(EObject referenceContainer, EReference crossReference)
Description copied from interface:IResolutionTargetDecider
Determines if the decider is of any use for the given resolving procedure.- Parameters:
referenceContainer
-crossReference
-- Returns:
- true for classifier references and references that are not method calls
-
resolveRelativeNamespace
public static EObject resolveRelativeNamespace(NamespaceAwareElement nsaElement, int idx, EObject startingPoint, EObject referenceContainer, EReference crossReference)
This method assumes that the namespace of the given namespace aware element is relative to the scope given by the starting point element. That is, each element of the namespace points to a classifier, where the first element points to a classifier available in the scope given by the starting point (i.e., define locally or imported).- Parameters:
nsaElement
- the namespace aware element.idx
- index into the namespaces to resolve.startingPoint
- the starting point element.referenceContainer
-crossReference
-- Returns:
- the classifier to which the last part of the namespace points, or null, if any part of the namespace can not be resolved to a classifier in the given scope
-
-