1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package dev.metaschema.core.metapath.function;
7   
8   import dev.metaschema.core.metapath.StaticMetapathException;
9   import dev.metaschema.core.qname.IEnhancedQName;
10  import edu.umd.cs.findbugs.annotations.NonNull;
11  
12  /**
13   * Resolves Metapath function signatures based on name and arity.
14   */
15  @FunctionalInterface
16  public interface IFunctionResolver {
17    /**
18     * Retrieve the function with the provided name that supports the signature of
19     * the provided methods.
20     *
21     * @param name
22     *          the name of a group of functions
23     * @param arity
24     *          the count of arguments for use in determining an argument signature
25     *          match
26     * @return the matching function
27     * @throws StaticMetapathException
28     *           with the code {@link StaticMetapathException#NO_FUNCTION_MATCH} if
29     *           a matching function was not found
30     */
31    @NonNull
32    IFunction getFunction(@NonNull IEnhancedQName name, int arity);
33  }