phopkins | aff72e0 | 2008-12-30 21:55:49 +0000 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2008 Google Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.google.inject.grapher; |
| 18 | |
phopkins | aff72e0 | 2008-12-30 21:55:49 +0000 | [diff] [blame] | 19 | import com.google.inject.spi.InjectionPoint; |
| 20 | |
| 21 | /** |
| 22 | * Interface for an edge from a class or {@link InjectionPoint} to the |
| 23 | * interface node that will satisfy the dependency. |
| 24 | * |
| 25 | * @author phopkins@gmail.com (Pete Hopkins) |
| 26 | * |
| 27 | * @param <K> The type for node IDs. |
| 28 | */ |
| 29 | public interface DependencyEdge<K> { |
| 30 | /** |
| 31 | * Factory interface for {@link DependencyEdge}s. Renderer implementations |
| 32 | * will need to provide an implementation for this. |
| 33 | * |
| 34 | * @param <K> The type for node IDs. |
| 35 | * @param <T> The {@link DependencyEdge} sub-type that this factory provides. |
| 36 | */ |
| 37 | interface Factory<K, T extends DependencyEdge<K>> { |
| 38 | /** |
| 39 | * Creates a new {@link DependencyEdge} and adds it to the graph. |
| 40 | * |
| 41 | * @param fromId The ID for the class or instance node that has the |
| 42 | * dependency. |
| 43 | * @param fromPoint The point where the dependency will be |
| 44 | * {@literal @}{@link Inject}ed. |
| 45 | * @param toId The ID for the interface node that satisfies the dependency. |
| 46 | */ |
sberlin | d9c913a | 2011-06-26 21:02:54 +0000 | [diff] [blame^] | 47 | T newDependencyEdge(K fromId, InjectionPoint fromPoint, K toId); |
phopkins | aff72e0 | 2008-12-30 21:55:49 +0000 | [diff] [blame] | 48 | } |
| 49 | } |