1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.el; |
20 | |
|
21 | |
import javax.el.ELContext; |
22 | |
import javax.faces.context.FacesContext; |
23 | |
import javax.faces.el.EvaluationException; |
24 | |
import javax.faces.el.PropertyNotFoundException; |
25 | |
import javax.faces.el.PropertyResolver; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
public final class NullPropertyResolver extends PropertyResolver { |
33 | |
|
34 | |
|
35 | 0 | public NullPropertyResolver() { |
36 | 0 | } |
37 | |
|
38 | |
public boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException { |
39 | 0 | elContext().setPropertyResolved(false); |
40 | 0 | return false; |
41 | |
} |
42 | |
|
43 | |
public boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException { |
44 | 0 | elContext().setPropertyResolved(false); |
45 | 0 | return false; |
46 | |
} |
47 | |
|
48 | |
public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { |
49 | 0 | elContext().setPropertyResolved(false); |
50 | 0 | return null; |
51 | |
} |
52 | |
|
53 | |
public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException { |
54 | 0 | elContext().setPropertyResolved(false); |
55 | 0 | return null; |
56 | |
} |
57 | |
|
58 | |
public Class getType(Object base, int index) throws EvaluationException, PropertyNotFoundException { |
59 | 0 | elContext().setPropertyResolved(false); |
60 | 0 | return null; |
61 | |
} |
62 | |
|
63 | |
public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException { |
64 | 0 | elContext().setPropertyResolved(false); |
65 | 0 | return null; |
66 | |
} |
67 | |
|
68 | |
public void setValue(Object base, Object property, Object value) throws EvaluationException, PropertyNotFoundException { |
69 | 0 | elContext().setPropertyResolved(false); |
70 | 0 | } |
71 | |
|
72 | |
public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException { |
73 | 0 | elContext().setPropertyResolved(false); |
74 | 0 | } |
75 | |
|
76 | |
private ELContext elContext() { |
77 | 0 | return FacesContext.getCurrentInstance().getELContext(); |
78 | |
} |
79 | |
|
80 | |
} |