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.
  • Constructor Details

    • ConcreteClassifierDecider

      public ConcreteClassifierDecider()
  • Method Details

    • 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 interface IResolutionTargetDecider
      Overrides:
      reset in class AbstractDecider
    • 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 interface IResolutionTargetDecider
      Overrides:
      getAdditionalCandidates in class AbstractDecider
      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