Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
UrumaProviderCreator |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2004-2008 the Seasar Foundation and the Others. | |
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, | |
13 | * either express or implied. See the License for the specific language | |
14 | * governing permissions and limitations under the License. | |
15 | */ | |
16 | package org.seasar.uruma.container.creator; | |
17 | ||
18 | import org.seasar.framework.container.ComponentCreator; | |
19 | import org.seasar.framework.container.ComponentCustomizer; | |
20 | import org.seasar.framework.container.assembler.AutoBindingDefFactory; | |
21 | import org.seasar.framework.container.creator.ComponentCreatorImpl; | |
22 | import org.seasar.framework.container.deployer.InstanceDefFactory; | |
23 | import org.seasar.framework.convention.NamingConvention; | |
24 | ||
25 | /** | |
26 | * Providerクラス用の {@link ComponentCreator}です。 | |
27 | * <p> | |
28 | * 決められた命名規約に従って、クラスからProviderクラスのコンポーネント定義を作成します。 作成されるコンポーネント定義の各種属性は以下になります。 | |
29 | * | |
30 | * <table> | |
31 | * <tr> | |
32 | * <th>サフィックス</th> | |
33 | * <td>Provider</td> | |
34 | * </tr> | |
35 | * <tr> | |
36 | * <th>インスタンス定義</th> | |
37 | * <td>SINGLETON</td> | |
38 | * </tr> | |
39 | * <tr> | |
40 | * <th>自動バインディング</th> | |
41 | * <td>無効</td> | |
42 | * </tr> | |
43 | * <tr> | |
44 | * <th>外部バインディング</th> | |
45 | * <td>無効</td> | |
46 | * </tr> | |
47 | * <tr> | |
48 | * <th>インターフェース</th> | |
49 | * <td>対象外</td> | |
50 | * </tr> | |
51 | * <tr> | |
52 | * <th>抽象クラス</th> | |
53 | * <td>対象外</td> | |
54 | * </tr> | |
55 | * </table> | |
56 | * </p> | |
57 | * | |
58 | * @author y.sugigami | |
59 | * | |
60 | */ | |
61 | public class UrumaProviderCreator extends ComponentCreatorImpl { | |
62 | ||
63 | /** | |
64 | * 指定された{@link NamingConvention 命名規約}に従った{@link UrumaProviderCreator}を作成します。 | |
65 | * | |
66 | * @param namingConvention | |
67 | * 命名規約 | |
68 | */ | |
69 | public UrumaProviderCreator(final NamingConvention namingConvention) { | |
70 | 0 | super(namingConvention); |
71 | 0 | setNameSuffix("Provider"); |
72 | 0 | setInstanceDef(InstanceDefFactory.SINGLETON); |
73 | 0 | setAutoBindingDef(AutoBindingDefFactory.NONE); |
74 | 0 | } |
75 | ||
76 | /** | |
77 | * {@link ComponentCustomizer}を返します。 | |
78 | * | |
79 | * @return コンポーネントカスタマイザ | |
80 | */ | |
81 | public ComponentCustomizer getProviderCustomizer() { | |
82 | 0 | return getCustomizer(); |
83 | } | |
84 | ||
85 | /** | |
86 | * {@link ComponentCustomizer}を設定します。 | |
87 | * | |
88 | * @param customizer | |
89 | * コンポーネントカスタマイザ | |
90 | */ | |
91 | public void setProviderCustomizer(final ComponentCustomizer customizer) { | |
92 | 0 | setCustomizer(customizer); |
93 | 0 | } |
94 | } |