DependencyResolver (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.graphdb

## Interface DependencyResolver

- All Known Implementing Classes:
    DependencyResolver.Adapter

      public interface DependencyResolver

  Find a dependency given a type. This can be the exact type or a super type of the actual dependency.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `DependencyResolver.Adapter` Adapter for `DependencyResolver` which will select the first available candidate by default for `DependencyResolver.Adapter.resolveDependency(Class)`.
    `static interface` | `DependencyResolver.SelectionStrategy` Responsible for making the choice between available candidates.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `resolveDependency(Class<T> type)` Tries to resolve a dependency that matches a given class.
    `<T> T` | `resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy selector)` Tries to resolve a dependency that matches a given class.

- - ### Method Detail

    - #### resolveDependency

          <T> T resolveDependency(Class<T> type)
                              throws IllegalArgumentException

      Tries to resolve a dependency that matches a given class. No specific `DependencyResolver.SelectionStrategy` is used, so the first encountered matching dependency will be returned.
      Parameters:
        `type` - the type of `Class` that the returned instance must implement.
      Returns:
        the resolved dependency for the given type.
      Throws:
        `IllegalArgumentException` - if no matching dependency was found.

    - #### resolveDependency

          <T> T resolveDependency(Class<T> type,
                                DependencyResolver.SelectionStrategy selector)
                              throws IllegalArgumentException

      Tries to resolve a dependency that matches a given class. All candidates are fed to the `selector` which ultimately becomes responsible for making the choice between all available candidates.
      Parameters:
        `type` - the type of `Class` that the returned instance must implement.
        `selector` - `DependencyResolver.SelectionStrategy` which will make the choice of which one to return among matching candidates.
      Returns:
        the resolved dependency for the given type.
      Throws:
        `IllegalArgumentException` - if no matching dependency was found.

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.