1
|
|
#region Copyright
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
|
|
17
|
|
#endregion
|
18
|
|
|
19
|
|
using System;
|
20
|
|
using System.Reflection;
|
21
|
|
using Seasar.Framework.Beans;
|
22
|
|
|
23
|
|
namespace Seasar.Framework.Container.Assembler
|
24
|
|
{
|
25
|
|
|
26
|
|
|
27
|
|
|
28
|
|
public abstract class AbstractPropertyAssembler
|
29
|
|
: AbstractAssembler,IPropertyAssembler
|
30
|
|
{
|
31
|
477
|
public AbstractPropertyAssembler(IComponentDef componentDef)
|
32
|
|
: base(componentDef)
|
33
|
|
{
|
34
|
|
}
|
35
|
|
|
36
|
284
|
protected object GetValue(IPropertyDef propertyDef,object component)
|
37
|
|
{
|
38
|
284
|
try
|
39
|
|
{
|
40
|
284
|
return propertyDef.Value;
|
41
|
|
}
|
42
|
|
catch(ComponentNotFoundRuntimeException cause)
|
43
|
|
{
|
44
|
0
|
throw new IllegalPropertyRuntimeException(
|
45
|
|
this.GetComponentType(component),propertyDef.PropertyName,cause);
|
46
|
|
}
|
47
|
|
}
|
48
|
|
|
49
|
597
|
protected void SetValue(PropertyInfo propertyInfo,object component,object value)
|
50
|
|
{
|
51
|
0
|
if(value==null) return;
|
52
|
597
|
try
|
53
|
|
{
|
54
|
597
|
propertyInfo.SetValue(component,value,null);
|
55
|
|
}
|
56
|
|
catch(Exception ex)
|
57
|
|
{
|
58
|
1
|
throw new IllegalPropertyRuntimeException(
|
59
|
|
this.ComponentDef.ComponentType,propertyInfo.Name,ex);
|
60
|
|
}
|
61
|
|
}
|
62
|
|
|
63
|
|
#region PropertyAssembler メンバ
|
64
|
|
|
65
|
0
|
public virtual void Assemble(object component)
|
66
|
|
{
|
67
|
|
|
68
|
|
}
|
69
|
|
|
70
|
|
#endregion
|
71
|
|
}
|
72
|
|
}
|
73
|
|
|