Package: groovy.grape

## [Java] Interface GrapeEngine

-     public interface GrapeEngine

  Contract for Grape dependency resolution engines.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `addResolver(Map<String, Object> args)` Adds a resolver to this engine.
    `` | `public Map<String, Map<String, List<String>>>` | `enumerateGrapes()` Enumerates locally available grapes.
    `` | `public Object` | `grab(String endorsedModule)` Grabs a dependency expressed using the endorsed module shorthand.
    `` | `public Object` | `grab(Map args)` Grabs a single dependency.
    `` | `public Object` | `grab(Map args, Map dependencies)` Grabs one or more dependencies using the supplied arguments.
    `` | `public Map[]` | `listDependencies(ClassLoader classLoader)` Lists dependencies associated with the supplied class loader.
    `` | `public URI[]` | `resolve(Map args, Map dependencies)` Resolves dependency coordinates to artifact URIs.
    `` | `public URI[]` | `resolve(Map args, List depsInfo, Map dependencies)` Resolves dependency coordinates to artifact URIs while optionally collecting dependency information.
    `` | `public void` | `setLoggingLevel(int level)` Sets the logging level for the grape engine.

- - ### Method Detail

    - #### public void addResolver(Map<String, Object> args)

      Adds a resolver to this engine.

      Parameters:
        `args` - the resolver descriptor

    - #### public Map<String, Map<String, List<String>>> enumerateGrapes()

      Enumerates locally available grapes.

      Returns:
        grapes grouped by organization and module

    - #### public Object grab(String endorsedModule)

      Grabs a dependency expressed using the endorsed module shorthand.

      Parameters:
        `endorsedModule` - the endorsed module notation
      Returns:
        an engine-specific result

    - #### public Object grab(Map args)

      Grabs a single dependency.

      Parameters:
        `args` - the dependency descriptor
      Returns:
        an engine-specific result

    - #### public Object grab(Map args, Map dependencies)

      Grabs one or more dependencies using the supplied arguments.

      Parameters:
        `args` - grab arguments
        `dependencies` - dependency descriptors
      Returns:
        an engine-specific result

    - #### public Map[] listDependencies(ClassLoader classLoader)

      Lists dependencies associated with the supplied class loader.

      Parameters:
        `classLoader` - the class loader to inspect
      Returns:
        the dependency descriptors

    - #### public URI[] resolve(Map args, Map dependencies)

      Resolves dependency coordinates to artifact URIs.

      Parameters:
        `args` - resolve arguments
        `dependencies` - dependency descriptors
      Returns:
        the resolved artifact URIs

    - #### public URI[] resolve(Map args, List depsInfo, Map dependencies)

      Resolves dependency coordinates to artifact URIs while optionally collecting dependency information.

      Parameters:
        `args` - resolve arguments
        `depsInfo` - optional dependency metadata sink
        `dependencies` - dependency descriptors
      Returns:
        the resolved artifact URIs

    - #### public void setLoggingLevel(int level)

      Sets the logging level for the grape engine.

      Parameters:
        `level` - the logging level (0=quiet/errors only, 1=warn, 2=info, 3=verbose, 4=debug)
      Since:
        6.0.0