01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.myfaces.el;
20:
21: import javax.faces.context.FacesContext;
22: import javax.faces.el.EvaluationException;
23: import javax.faces.el.PropertyNotFoundException;
24: import javax.faces.el.PropertyResolver;
25:
26: /**
27: * Implements the default property resolver see spec section 5.8.2.
28: *
29: * @author Mathias Broekelmann (latest modification by $Author: mbr $)
30: * @version $Revision: 511514 $ $Date: 2007-02-25 14:47:48 +0100 (So, 25 Feb 2007) $
31: */
32: @SuppressWarnings("deprecation")
33: public class DefaultPropertyResolver extends PropertyResolver {
34: private void updatePropertyResolved() {
35: FacesContext.getCurrentInstance().getELContext()
36: .setPropertyResolved(false);
37: }
38:
39: @Override
40: public Class getType(Object base, int index)
41: throws EvaluationException, PropertyNotFoundException {
42: updatePropertyResolved();
43: return null;
44: }
45:
46: @Override
47: public Class getType(Object base, Object property)
48: throws EvaluationException, PropertyNotFoundException {
49: updatePropertyResolved();
50: return null;
51: }
52:
53: @Override
54: public Object getValue(Object base, int index)
55: throws EvaluationException, PropertyNotFoundException {
56: updatePropertyResolved();
57: return null;
58: }
59:
60: @Override
61: public Object getValue(Object base, Object property)
62: throws EvaluationException, PropertyNotFoundException {
63: updatePropertyResolved();
64: return null;
65: }
66:
67: @Override
68: public boolean isReadOnly(Object base, int index)
69: throws EvaluationException, PropertyNotFoundException {
70: updatePropertyResolved();
71: return false;
72: }
73:
74: @Override
75: public boolean isReadOnly(Object base, Object property)
76: throws EvaluationException, PropertyNotFoundException {
77: updatePropertyResolved();
78: return false;
79: }
80:
81: @Override
82: public void setValue(Object base, int index, Object value)
83: throws EvaluationException, PropertyNotFoundException {
84: updatePropertyResolved();
85: }
86:
87: @Override
88: public void setValue(Object base, Object property, Object value)
89: throws EvaluationException, PropertyNotFoundException {
90: updatePropertyResolved();
91: }
92:
93: }
|