1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.view.facelets.tag.jstl.core;
20
21 import javax.el.ELContext;
22 import javax.el.ValueExpression;
23
24
25
26
27
28 public final class IndexedValueExpression extends ValueExpression
29 {
30
31
32
33
34 private static final long serialVersionUID = 1L;
35
36 private final Integer i;
37
38 private final ValueExpression orig;
39
40
41
42
43 public IndexedValueExpression(ValueExpression orig, int i)
44 {
45 this.i = Integer.valueOf(i);
46 this.orig = orig;
47 }
48
49
50
51
52
53
54 public Object getValue(ELContext context)
55 {
56 Object base = this.orig.getValue(context);
57 if (base != null)
58 {
59 context.setPropertyResolved(false);
60 return context.getELResolver().getValue(context, base, i);
61 }
62 return null;
63 }
64
65
66
67
68
69
70 public void setValue(ELContext context, Object value)
71 {
72 Object base = this.orig.getValue(context);
73 if (base != null)
74 {
75 context.setPropertyResolved(false);
76 context.getELResolver().setValue(context, base, i, value);
77 }
78 }
79
80
81
82
83
84
85 public boolean isReadOnly(ELContext context)
86 {
87 Object base = this.orig.getValue(context);
88 if (base != null)
89 {
90 context.setPropertyResolved(false);
91 return context.getELResolver().isReadOnly(context, base, i);
92 }
93 return true;
94 }
95
96
97
98
99
100
101 public Class getType(ELContext context)
102 {
103 Object base = this.orig.getValue(context);
104 if (base != null)
105 {
106 context.setPropertyResolved(false);
107 return context.getELResolver().getType(context, base, i);
108 }
109 return null;
110 }
111
112
113
114
115
116
117 public Class getExpectedType()
118 {
119 return Object.class;
120 }
121
122
123
124
125
126
127 public String getExpressionString()
128 {
129 return this.orig.getExpressionString();
130 }
131
132
133
134
135
136
137 public boolean equals(Object obj)
138 {
139 return this.orig.equals(obj);
140 }
141
142
143
144
145
146
147 public int hashCode()
148 {
149 return this.orig.hashCode();
150 }
151
152
153
154
155
156
157 public boolean isLiteralText()
158 {
159 return false;
160 }
161
162 }