Class OperationContributorRegistry
- java.lang.Object
-
- org.eclipse.epsilon.eol.execute.operations.contributors.OperationContributorRegistry
-
public class OperationContributorRegistry extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description OperationContributorRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(OperationContributor operationContributor)
Adds the specifiedOperationContributor
to the list of contributors used to discover contributed operations by the registry.ObjectMethod
findContributedMethodForEvaluatedParameters(java.lang.Object target, java.lang.String name, java.lang.Object[] parameters, IEolContext context)
Finds a contributed operation for the given target, name and parameters.ObjectMethod
findContributedMethodForUnevaluatedParameters(java.lang.Object target, java.lang.String name, java.util.List<Expression> parameterExpressions, IEolContext context)
Finds a contributed operation that is invoked without prior evaluation (i.e.protected java.util.List<OperationContributor>
getDefaultOperationContributors()
The list ofOperationContributor
s used to discover contributed operations by the registry.protected java.util.Collection<OperationContributor>
getOperationContributorsFor(java.lang.Object target, IEolContext context)
java.util.stream.Stream<OperationContributor>
stream()
-
-
-
Method Detail
-
add
public void add(OperationContributor operationContributor)
Adds the specified
OperationContributor
to the list of contributors used to discover contributed operations by the registry. Contributors added with this method have a lower precedence than the default operation contributors.To add an operation contributor with a higher precedence than one or more of the default operation contributors, define a subclass that overrides the
getDefaultOperationContributors()
method.
-
getDefaultOperationContributors
protected java.util.List<OperationContributor> getDefaultOperationContributors()
The list ofOperationContributor
s used to discover contributed operations by the registry. Subclasses may override this method to add, remove or change the order of theOperationContributor
s used by the registry.
-
findContributedMethodForUnevaluatedParameters
public ObjectMethod findContributedMethodForUnevaluatedParameters(java.lang.Object target, java.lang.String name, java.util.List<Expression> parameterExpressions, IEolContext context)
Finds a contributed operation that is invoked without prior evaluation (i.e. the contributed operation evaluates its own AST). This category of contributed operation is rare, but can be used for rewriting parts of the AST at runtime or for selective logging or tracing. See, for example, EGL's contributor for OutputBuffer's print operations.
-
findContributedMethodForEvaluatedParameters
public ObjectMethod findContributedMethodForEvaluatedParameters(java.lang.Object target, java.lang.String name, java.lang.Object[] parameters, IEolContext context)
Finds a contributed operation for the given target, name and parameters. This is the most common mechanism for contributing an operation. Operations contributed in this manner are invoked after their parameters have been evaluated.
-
getOperationContributorsFor
protected java.util.Collection<OperationContributor> getOperationContributorsFor(java.lang.Object target, IEolContext context)
-
stream
public java.util.stream.Stream<OperationContributor> stream()
- Returns:
- Since:
- 1.6
-
-