Class OperationContributor
- java.lang.Object
-
- org.eclipse.epsilon.eol.execute.operations.contributors.OperationContributor
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
AnyOperationContributor
,ArrayOperationContributor
,AssertWarningOperationContributor
,BasicEUnitOperationContributor
,BooleanOperationContributor
,ContextlessOperationContributor
,DateOperationContributor
,DictionaryModelOperationContributor
,EClassOperationContributor
,EmgOperationContributor
,EModelElementOperationContributor
,EUnitTask.RunTargetOperationContributor
,ExtraEUnitOperationContributor
,IntegerOperationContributor
,IterableOperationContributor
,MixedElementOperationContributor
,ModelElementOperationContributor
,ModelOperationContributor
,NumberOperationContributor
,PictoOperationContributor
,PlainXMLOperationContributor
,ReflectiveOperationContributor
,RequirementModelOperationContributor
,ScalarOperationContributor
,SimpleOperatorContributor
,StringCompatibilityOperationContributor
,StringOperationContributor
,WrapperOperationContributor
,YamlModelOperationContributor
public abstract class OperationContributor extends Object implements AutoCloseable
Implementation note: All extending classes should ensure that the operation contributor is stateless, or if it contains state (i.e. fields) then they are either immutable or ThreadLocal.
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>
cachedMethodNames
-
Constructor Summary
Constructors Constructor Description OperationContributor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Clears the target and context.abstract boolean
contributesTo(Object target)
ObjectMethod
findContributedMethodForEvaluatedParameters(Object target, String name, Object[] parameters, IEolContext context)
ObjectMethod
findContributedMethodForEvaluatedParameters(Object target, String name, Object[] parameters, IEolContext context, boolean overrideContextOperationContributorRegistry)
ObjectMethod
findContributedMethodForUnevaluatedParameters(Object target, String name, List<Expression> parameterExpressions, IEolContext context)
protected IEolContext
getContext()
protected Object
getReflectionTarget(Object target)
protected Object
getTarget()
protected boolean
includeInheritedMethods()
Specifies whether methods in the supertype of the contributor should be included when finding contributed operations.void
setContext(IEolContext context)
void
setTarget(Object target)
-
-
-
Method Detail
-
contributesTo
public abstract boolean contributesTo(Object target)
-
findContributedMethodForUnevaluatedParameters
public ObjectMethod findContributedMethodForUnevaluatedParameters(Object target, String name, List<Expression> parameterExpressions, IEolContext context)
-
findContributedMethodForEvaluatedParameters
public ObjectMethod findContributedMethodForEvaluatedParameters(Object target, String name, Object[] parameters, IEolContext context)
-
findContributedMethodForEvaluatedParameters
public ObjectMethod findContributedMethodForEvaluatedParameters(Object target, String name, Object[] parameters, IEolContext context, boolean overrideContextOperationContributorRegistry)
-
includeInheritedMethods
protected boolean includeInheritedMethods()
Specifies whether methods in the supertype of the contributor should be included when finding contributed operations. Typically, this should not be the case and, as such, this method returns false by default.
-
setTarget
public void setTarget(Object target)
-
setContext
public void setContext(IEolContext context)
-
getContext
protected IEolContext getContext()
- Returns:
- Since:
- 1.6
-
close
public void close()
Clears the target and context.- Specified by:
close
in interfaceAutoCloseable
- Since:
- 2.2
-
-