1 /*
2 * Copyright 2007-2008 Naoki NOSE.
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 package jp.liq.container;
17
18 import jp.liq.container.vocabulary.Components;
19 import jp.liq.container.vocabulary.ComponentsConfig;
20 import jp.liq.container.vocabulary.Ctor;
21 import jp.liq.container.vocabulary.Fields;
22 import jp.liq.container.vocabulary.Injectors;
23 import jp.liq.container.vocabulary.Methods;
24 import jp.liq.container.vocabulary.SentinelConfig;
25
26 /**
27 * {@link Container} を設定するための語彙です。
28 * このインタフェースに定義されたフィールドを起点として、ModuleやComponentの定義が比較的簡単に行えます。
29 * コードの中で、ContainerやModuleの定義を行う箇所で、
30 * このインタフェースを実装するか、static フィールドをstaticインポートして使用します。
31 * @author nosen
32 */
33 public interface ContainerVocabulary {
34 /**
35 * {@link jp.liq.container.Component} のインスタンスを生成します。
36 */
37 static final Components component = new Components();
38 /**
39 * {@link jp.liq.container.reflect.ConstructorWrapper}のインスタンスを生成します。
40 */
41 static final Ctor ctor = new Ctor();
42 /**
43 * {@link jp.liq.container.reflect.ClassMethodFinder}のインスタンスを生成します。
44 */
45 static final Methods methods = new Methods();
46 /**
47 * {@link jp.liq.container.reflect.ClassFieldFinder}のインスタンスを生成します。
48 */
49 static final Fields fields = new Fields();
50 /**
51 * {@link jp.liq.container.Injector} のインスタンスを生成します。
52 */
53 static final Injectors injector = new Injectors();
54 /**
55 * Container によってインスタンス化プロセスを管理されるクラスを一つ一つ定義します。
56 */
57 static final ComponentsConfig components = new ComponentsConfig();
58 /**
59 * コンストラクタを一つ持つ任意の具象クラスのインスタンスを生成できるように、
60 * Container を設定します。
61 */
62 static final SentinelConfig sentinel = new SentinelConfig();
63 }