1 29 30 package com.caucho.el; 31 32 import com.caucho.util.L10N; 33 34 import javax.el.ELContext; 35 import javax.el.ELException; 36 import javax.el.PropertyNotFoundException; 37 import java.util.logging.Logger ; 38 39 42 public class StringValueExpression extends AbstractValueExpression 43 { 44 protected static final Logger log 45 = Logger.getLogger(StringValueExpression.class.getName()); 46 protected static final L10N L = new L10N(StringValueExpression.class); 47 48 private Class _expectedType; 49 50 public StringValueExpression(Expr expr, 51 String expressionString, 52 Class expectedType) 53 { 54 super(expr, expressionString); 55 56 _expectedType = expectedType; 57 } 58 59 public StringValueExpression(Expr expr, 60 String expressionString) 61 { 62 super(expr, expressionString); 63 } 64 65 public StringValueExpression(Expr expr) 66 { 67 super(expr); 68 } 69 70 public Class <?> getExpectedType() 71 { 72 if (_expectedType != null) 73 return _expectedType; 74 else 75 return String .class; 76 } 77 78 public Class <?> getType(ELContext context) 79 throws PropertyNotFoundException, 80 ELException 81 { 82 return String .class; 83 } 84 85 @Override 86 public Object getValue(ELContext context) 87 throws PropertyNotFoundException, 88 ELException 89 { 90 return _expr.evalString(context); 91 } 92 } 93 | Popular Tags |