View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
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$)
30   * @version $Revision$ $Date$
31   */
32  @SuppressWarnings("deprecation")
33  public final class DefaultPropertyResolver extends PropertyResolver
34  {
35      private void updatePropertyResolved()
36      {
37          FacesContext.getCurrentInstance().getELContext().setPropertyResolved(false);
38      }
39  
40      @Override
41      public Class getType(Object base, int index) throws EvaluationException, PropertyNotFoundException
42      {
43          updatePropertyResolved();
44          return null;
45      }
46  
47      @Override
48      public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException
49      {
50          updatePropertyResolved();
51          return null;
52      }
53  
54      @Override
55      public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException
56      {
57          updatePropertyResolved();
58          return null;
59      }
60  
61      @Override
62      public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException
63      {
64          updatePropertyResolved();
65          return null;
66      }
67  
68      @Override
69      public boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException
70      {
71          updatePropertyResolved();
72          return false;
73      }
74  
75      @Override
76      public boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException
77      {
78          updatePropertyResolved();
79          return false;
80      }
81  
82      @Override
83      public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException
84      {
85          updatePropertyResolved();
86      }
87  
88      @Override
89      public void setValue(Object base, Object property, Object value) throws EvaluationException,
90              PropertyNotFoundException
91      {
92          updatePropertyResolved();
93      }
94  
95  }