01: /*
02: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
03: *
04: * This file is part of Resin(R) Open Source
05: *
06: * Each copy or derived work must preserve the copyright notice and this
07: * notice unmodified.
08: *
09: * Resin Open Source is free software; you can redistribute it and/or modify
10: * it under the terms of the GNU General Public License version 2
11: * as published by the Free Software Foundation.
12: *
13: * Resin Open Source is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
16: * of NON-INFRINGEMENT. See the GNU General Public License for more
17: * details.
18: *
19: * You should have received a copy of the GNU General Public License
20: * along with Resin Open Source; if not, write to the
21: *
22: * Free Software Foundation, Inc.
23: * 59 Temple Place, Suite 330
24: * Boston, MA 02111-1307 USA
25: *
26: * @author Scott Ferguson
27: */
28:
29: package com.caucho.jsf.el;
30:
31: import javax.el.*;
32: import javax.faces.context.*;
33: import javax.faces.el.*;
34:
35: public class ValueBindingAdapter extends ValueBinding {
36: private final ValueExpression _expr;
37:
38: public ValueBindingAdapter(ValueExpression expr) {
39: _expr = expr;
40: }
41:
42: @Deprecated
43: public Object getValue(FacesContext context)
44: throws EvaluationException,
45: javax.faces.el.PropertyNotFoundException {
46: try {
47: return _expr.getValue(context.getELContext());
48: } catch (javax.el.PropertyNotFoundException e) {
49: throw new javax.faces.el.PropertyNotFoundException(e);
50: }
51: }
52:
53: @Deprecated
54: public void setValue(FacesContext context, Object value)
55: throws EvaluationException,
56: javax.faces.el.PropertyNotFoundException {
57: try {
58: _expr.setValue(context.getELContext(), value);
59: } catch (javax.el.PropertyNotFoundException e) {
60: throw new javax.faces.el.PropertyNotFoundException(e);
61: }
62: }
63:
64: @Deprecated
65: public boolean isReadOnly(FacesContext context)
66: throws EvaluationException,
67: javax.faces.el.PropertyNotFoundException {
68: try {
69: return _expr.isReadOnly(context.getELContext());
70: } catch (javax.el.PropertyNotFoundException e) {
71: throw new javax.faces.el.PropertyNotFoundException(e);
72: }
73: }
74:
75: @Deprecated
76: public Class getType(FacesContext context)
77: throws EvaluationException,
78: javax.faces.el.PropertyNotFoundException {
79: try {
80: return _expr.getType(context.getELContext());
81: } catch (javax.el.PropertyNotFoundException e) {
82: throw new javax.faces.el.PropertyNotFoundException(e);
83: }
84: }
85:
86: @Deprecated
87: public String getExpressionString() {
88: return _expr.getExpressionString();
89: }
90:
91: public String toString() {
92: return "ValueBindingAdapter[" + _expr.getExpressionString()
93: + "]";
94: }
95: }
|