blob: 5b454a784f71f9ce96887093e59bc48e65dcc192 [file] [log] [blame]
phopkinsaff72e02008-12-30 21:55:49 +00001/**
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
17package com.google.inject.grapher;
18
phopkinsaff72e02008-12-30 21:55:49 +000019import 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 */
29public 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 */
sberlind9c913a2011-06-26 21:02:54 +000047 T newDependencyEdge(K fromId, InjectionPoint fromPoint, K toId);
phopkinsaff72e02008-12-30 21:55:49 +000048 }
49}