Class OperationContributorRegistry


  • public class OperationContributorRegistry
    extends java.lang.Object
    • Constructor Detail

      • OperationContributorRegistry

        public OperationContributorRegistry()
    • 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 of OperationContributors used to discover contributed operations by the registry. Subclasses may override this method to add, remove or change the order of the OperationContributors 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)