This project has retired. For details please refer to its
Attic page.
DelegatePropertyAccessor xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.tiles.ognl;
23
24 import java.util.Map;
25
26 import ognl.OgnlContext;
27 import ognl.OgnlException;
28 import ognl.PropertyAccessor;
29
30
31
32
33
34
35
36
37
38 public class DelegatePropertyAccessor<T> implements PropertyAccessor {
39
40
41
42
43
44
45 private PropertyAccessorDelegateFactory<T> factory;
46
47
48
49
50
51
52
53 public DelegatePropertyAccessor(PropertyAccessorDelegateFactory<T> factory) {
54 this.factory = factory;
55 }
56
57
58 @SuppressWarnings("unchecked")
59 public Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name)
60 throws OgnlException {
61 return factory.getPropertyAccessor((String) name, (T) target).getProperty(
62 context, target, name);
63 }
64
65
66 @SuppressWarnings("unchecked")
67 public void setProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name,
68 Object value) throws OgnlException {
69 factory.getPropertyAccessor((String) name, (T) target).setProperty(context,
70 target, name, value);
71 }
72
73
74 @SuppressWarnings("unchecked")
75 public String getSourceAccessor(OgnlContext context, Object target,
76 Object index) {
77 return factory.getPropertyAccessor((String) index, (T) target)
78 .getSourceAccessor(context, target, index);
79 }
80
81
82 @SuppressWarnings("unchecked")
83 public String getSourceSetter(OgnlContext context, Object target,
84 Object index) {
85 return factory.getPropertyAccessor((String) index, (T) target)
86 .getSourceSetter(context, target, index);
87 }
88 }