Class AbstractDecider
- java.lang.Object
-
- org.emftext.language.java.resolver.decider.AbstractDecider
-
- All Implemented Interfaces:
IResolutionTargetDecider
- Direct Known Subclasses:
ConcreteClassifierDecider
,EnumConstantDecider
,FieldDecider
,InterfaceMethodDecider
,LocalVariableDecider
,MethodDecider
,PackageDecider
,ParameterDecider
,TypeParameterDecider
public abstract class AbstractDecider extends Object implements IResolutionTargetDecider
Default implementation of the interface that provides default behavior for some methods.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
active
-
Constructor Summary
Constructors Constructor Description AbstractDecider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate()
Implements the interface specification.boolean
continueAfterReference()
Defines, if the scoping for this decider allows to look behind the point where the reference, for which the target is searched, was defined.void
deactivate()
Implements the interface specification.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
isActive()
Implements the interface specification.boolean
isSure()
Should return true, if the last timeisPossibleTarget()
returned true was the final decision (i.e., traversal can be stopped).void
reset()
Resets the state of the decider before a complete new walk takes place.boolean
walkInto(EObject element)
Determines if references given element, which is a child of the elements visited by default in the tree traversing, should also be considered.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.emftext.language.java.resolver.decider.IResolutionTargetDecider
canFindTargetsFor, containsCandidates, isPossibleTarget
-
-
-
-
Method Detail
-
continueAfterReference
public boolean continueAfterReference()
Description copied from interface:IResolutionTargetDecider
Defines, if the scoping for this decider allows to look behind the point where the reference, for which the target is searched, was defined.- Specified by:
continueAfterReference
in interfaceIResolutionTargetDecider
- Returns:
- true by default
-
walkInto
public boolean walkInto(EObject element)
Description copied from interface:IResolutionTargetDecider
Determines if references given element, which is a child of the elements visited by default in the tree traversing, should also be considered.- Specified by:
walkInto
in interfaceIResolutionTargetDecider
- Parameters:
element
-- Returns:
- false by default
-
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
- Parameters:
identifier
-container
-- Returns:
- null (corresponds to empty list) by default
-
isSure
public boolean isSure()
Description copied from interface:IResolutionTargetDecider
Should return true, if the last timeisPossibleTarget()
returned true was the final decision (i.e., traversal can be stopped).- Specified by:
isSure
in interfaceIResolutionTargetDecider
- Returns:
- true by default
-
activate
public void activate()
Implements the interface specification. Do not override.- Specified by:
activate
in interfaceIResolutionTargetDecider
-
deactivate
public void deactivate()
Implements the interface specification. Do not override.- Specified by:
deactivate
in interfaceIResolutionTargetDecider
-
isActive
public boolean isActive()
Implements the interface specification. Do not override.- Specified by:
isActive
in interfaceIResolutionTargetDecider
- Returns:
- true if the decider is active. false otherwise.
-
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
-
-