1 23 24 package javax.servlet.jsp.jstl.core; 25 26 import javax.el.ELContext; 27 import javax.el.ValueExpression; 28 29 33 public final class IndexedValueExpression extends ValueExpression { 34 35 38 private static final long serialVersionUID = 1L; 39 protected final Integer i; 40 protected final ValueExpression orig; 41 42 45 public IndexedValueExpression(ValueExpression orig, int i) { 46 this.i = new Integer (i); 47 this.orig = orig; 48 } 49 50 55 public Object getValue(ELContext context) { 56 Object base = this.orig.getValue(context); 57 if (base != null) { 58 context.setPropertyResolved(false); 59 return context.getELResolver().getValue(context, base, i); 60 } 61 return null; 62 } 63 64 70 public void setValue(ELContext context, Object value) { 71 Object base = this.orig.getValue(context); 72 if (base != null) { 73 context.setPropertyResolved(false); 74 context.getELResolver().setValue(context, base, i, value); 75 } 76 } 77 78 83 public boolean isReadOnly(ELContext context) { 84 Object base = this.orig.getValue(context); 85 if (base != null) { 86 context.setPropertyResolved(false); 87 return context.getELResolver().isReadOnly(context, base, i); 88 } 89 return true; 90 } 91 92 97 public Class getType(ELContext context) { 98 Object base = this.orig.getValue(context); 99 if (base != null) { 100 context.setPropertyResolved(false); 101 return context.getELResolver().getType(context, base, i); 102 } 103 return null; 104 } 105 106 111 public Class getExpectedType() { 112 return Object .class; 113 } 114 115 120 public String getExpressionString() { 121 return this.orig.getExpressionString(); 122 } 123 124 129 public boolean equals(Object obj) { 130 return this.orig.equals(obj); 131 } 132 133 138 public int hashCode() { 139 return this.orig.hashCode(); 140 } 141 142 147 public boolean isLiteralText() { 148 return false; 149 } 150 151 } 152 153 | Popular Tags |