Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 386   Methods: 46
NCLOC: 232 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Container\Impl\SimpleComponentDef.cs - 22.0% 21.7% 21.8%
coverage coverage
1   #region Copyright
2   /*
3   * Copyright 2005 the Seasar Foundation and the Others.
4   *
5   * Licensed under the Apache License, Version 2.0 (the "License");
6   * you may not use this file except in compliance with the License.
7   * You may obtain a copy of the License at
8   *
9   * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14   * either express or implied. See the License for the specific language
15   * governing permissions and limitations under the License.
16   */
17   #endregion
18  
19   using System;
20   using System.Collections;
21  
22   namespace Seasar.Framework.Container.Impl
23   {
24   /// <summary>
25   /// コンポーネントのインスタンスを直接返す場合に使用されます。
26   /// </summary>
27   public class SimpleComponentDef : IComponentDef
28   {
29   private object component_;
30   private Type componentType_;
31   private string componentName_;
32   private IS2Container container_;
33   private IDictionary proxies_ = new Hashtable();
34  
35   /// <summary>
36   /// コンストラクタ
37   /// </summary>
38 245 public SimpleComponentDef()
39   {
40   }
41  
42   /// <summary>
43   /// コンストラクタ
44   /// </summary>
45   /// <param name="componentType">コンポーネントのType</param>
46 1000 public SimpleComponentDef(Type componentType)
47   : this(null,componentType,null)
48   {
49   }
50  
51   /// <summary>
52   /// コンストラクタ
53   /// </summary>
54   /// <param name="component">コンポーネント</param>
55 0 public SimpleComponentDef(object component)
56   : this(component,component.GetType())
57   {
58   }
59  
60   /// <summary>
61   /// コンストラクタ
62   /// </summary>
63   /// <param name="component">コンポーネント</param>
64   /// <param name="componentType">コンポーネントのType</param>
65 0 public SimpleComponentDef(object component,Type componentType)
66   : this(component,componentType,null)
67   {
68   }
69  
70   /// <summary>
71   /// コンストラクタ
72   /// </summary>
73   /// <param name="component">コンポーネント</param>
74   /// <param name="componentName">コンポーネントの名前</param>
75 440 public SimpleComponentDef(object component,string componentName)
76   : this(component,component.GetType(),componentName)
77   {
78   }
79  
80   /// <summary>
81   /// コンストラクタ
82   /// </summary>
83   /// <param name="component">コンポーネント</param>
84   /// <param name="componentType">コンポーネントのType</param>
85   /// <param name="componentName">コンポーネントの名前</param>
86 1440 public SimpleComponentDef(object component, Type componentType,string componentName)
87   {
88 1440 component_ = component;
89 1440 componentType_ = componentType;
90 1440 componentName_ = componentName;
91   }
92  
93   #region ComponentDef メンバ
94  
95 95 public virtual object GetComponent()
96   {
97 95 return component_;
98   }
99  
100 2 public virtual object GetComponent(Type receiveType)
101   {
102 2 return component_;
103   }
104  
105 0 public void InjectDependency(Object outerComponent)
106   {
107  
108   throw new NotSupportedException("InjectDependency");
109   }
110  
111   public IS2Container Container
112   {
113 3 get
114   {
115  
116 3 return container_;
117   }
118 3 set
119   {
120  
121 3 container_ = value;
122   }
123   }
124  
125   public Type ComponentType
126   {
127 50 get
128   {
129  
130 50 return componentType_;
131   }
132   }
133  
134   public string ComponentName
135   {
136 3 get
137   {
138  
139 3 return componentName_;
140   }
141   }
142  
143 0 public string AutoBindingMode
144   {
145   get
146   {
147  
148   throw new NotSupportedException("AutoBindingMode");
149   }
150   set
151   {
152  
153   throw new NotSupportedException("AutoBindingMode");
154   }
155   }
156  
157 0 public string InstanceMode
158   {
159   get
160   {
161  
162   throw new NotSupportedException("InstanceMode");
163   }
164   set
165   {
166  
167   throw new NotSupportedException("InstanceMode");
168   }
169   }
170  
171 0 public string Expression
172   {
173   get
174   {
175  
176   throw new NotSupportedException("Expression");
177   }
178   set
179   {
180  
181   throw new NotSupportedException("Expression");
182   }
183   }
184  
185 0 public void Init()
186   {
187  
188   }
189  
190 0 public void Destroy()
191   {
192   }
193  
194 0 public object GetProxy(Type proxyType)
195   {
196   return proxies_[proxyType];
197   }
198  
199 0 public void AddProxy(Type proxyType, object proxy)
200   {
201   proxies_[proxyType] = proxy;
202   }
203  
204   #endregion
205  
206   #region IArgDefAware メンバ
207  
208 0 public void AddArgDef(IArgDef argDef)
209   {
210  
211   throw new NotSupportedException("AddArgDef");
212   }
213  
214 0 public int ArgDefSize
215   {
216   get
217   {
218  
219   throw new NotSupportedException("ArgDefSize");
220   }
221   }
222  
223 0 public IArgDef GetArgDef(int index)
224   {
225  
226   throw new NotSupportedException("GetArgDef");
227   }
228  
229   #endregion
230  
231   #region IPropertyDefAware メンバ
232  
233 0 public void AddPropertyDef(IPropertyDef propertyDef)
234   {
235  
236   throw new NotSupportedException("AddPropertyDef");
237   }
238  
239 0 public int PropertyDefSize
240   {
241   get
242   {
243  
244   throw new NotSupportedException("PropertyDefSize");
245   }
246   }
247  
248 0 public IPropertyDef GetPropertyDef(int index)
249   {
250  
251   throw new NotSupportedException("GetPropertyDef");
252   }
253  
254 0 public IPropertyDef GetPropertyDef(string propertyName)
255   {
256  
257   throw new NotSupportedException("GetPropertyDef");
258   }
259  
260 0 public bool HasPropertyDef(string propertyName)
261   {
262  
263   throw new NotSupportedException("HasPropertyDef");
264   }
265  
266   #endregion
267  
268   #region IInitMethodDefAware メンバ
269  
270 0 public void AddInitMethodDef(IInitMethodDef methodDef)
271   {
272  
273   throw new NotSupportedException("AddInitMethodDef");
274   }
275  
276 0 public int InitMethodDefSize
277   {
278   get
279   {
280  
281   throw new NotSupportedException("InitMethodDefSize");
282   }
283   }
284  
285 0 public IInitMethodDef GetInitMethodDef(int index)
286   {
287  
288   throw new NotSupportedException("GetInitMethodDef");
289   }
290  
291   #endregion
292  
293   #region IDestroyMethodDefAware メンバ
294  
295 0 public void AddDestroyMethodDef(IDestroyMethodDef methodDef)
296   {
297  
298   throw new NotSupportedException("AddDestroyMethodDef");
299   }
300  
301 0 public int DestroyMethodDefSize
302   {
303   get
304   {
305  
306   throw new NotSupportedException("DestroyMethodDefSize");
307   }
308   }
309  
310 0 public IDestroyMethodDef GetDestroyMethodDef(int index)
311   {
312  
313   throw new NotSupportedException("GetDestroyMethodDef");
314   }
315  
316 0 public IDestroyMethodDef[] GetDestroyMethodDefs()
317   {
318   throw new NotSupportedException("GetDestroyMethodDefs");
319   }
320  
321   #endregion
322  
323   #region IAspectDefAware メンバ
324  
325 0 public void AddAspeceDef(IAspectDef aspectDef)
326   {
327  
328   throw new NotSupportedException("AddAspectDef");
329   }
330  
331 0 public int AspectDefSize
332   {
333   get
334   {
335  
336   throw new NotSupportedException("AspectDefSize");
337   }
338   }
339  
340 0 public IAspectDef GetAspectDef(int index)
341   {
342  
343   throw new NotSupportedException("GetAspectDef");
344   }
345  
346   #endregion
347  
348   #region IMetaDefAware メンバ
349  
350 0 public void AddMetaDef(IMetaDef metaDef)
351   {
352  
353   throw new NotSupportedException("AddMetaDef");
354   }
355  
356 0 public int MetaDefSize
357   {
358   get
359   {
360  
361   throw new NotSupportedException("MetaDefSize");
362   }
363   }
364  
365 0 public IMetaDef GetMetaDef(int index)
366   {
367  
368   throw new NotSupportedException("GetMetaDef");
369   }
370  
371 0 public IMetaDef GetMetaDef(string name)
372   {
373  
374   throw new NotSupportedException("GetMethodDef");
375   }
376  
377 0 public IMetaDef[] GetMetaDefs(string name)
378   {
379  
380   throw new NotSupportedException("GetMetaDefs");
381   }
382  
383   #endregion
384   }
385   }
386