1 14 15 package com.sun.facelets.tag.jstl.core; 16 17 import java.util.Map ; 18 19 import javax.el.ELContext; 20 import javax.el.ValueExpression; 21 22 26 public final class MappedValueExpression extends ValueExpression { 27 28 31 private static final long serialVersionUID = 1L; 32 33 private final Object key; 34 35 private final ValueExpression orig; 36 37 40 public MappedValueExpression(ValueExpression orig, Map.Entry entry) { 41 this.orig = orig; 42 this.key = entry.getKey(); 43 } 44 45 50 public Object getValue(ELContext context) { 51 Object base = this.orig.getValue(context); 52 if (base != null) { 53 context.setPropertyResolved(false); 54 return context.getELResolver().getValue(context, base, key); 55 } 56 return null; 57 } 58 59 65 public void setValue(ELContext context, Object value) { 66 Object base = this.orig.getValue(context); 67 if (base != null) { 68 context.setPropertyResolved(false); 69 context.getELResolver().setValue(context, base, key, value); 70 } 71 } 72 73 78 public boolean isReadOnly(ELContext context) { 79 Object base = this.orig.getValue(context); 80 if (base != null) { 81 context.setPropertyResolved(false); 82 return context.getELResolver().isReadOnly(context, base, key); 83 } 84 return true; 85 } 86 87 92 public Class getType(ELContext context) { 93 Object base = this.orig.getValue(context); 94 if (base != null) { 95 context.setPropertyResolved(false); 96 return context.getELResolver().getType(context, base, key); 97 } 98 return null; 99 } 100 101 106 public Class getExpectedType() { 107 return Object .class; 108 } 109 110 115 public String getExpressionString() { 116 return this.orig.getExpressionString(); 117 } 118 119 124 public boolean equals(Object obj) { 125 return this.orig.equals(obj); 126 } 127 128 133 public int hashCode() { 134 return 0; 136 } 137 138 143 public boolean isLiteralText() { 144 return false; 146 } 147 148 } 149 | Popular Tags |