Coverage Report - org.apache.myfaces.el.NullPropertyResolver
 
Classes in this File Line Coverage Branch Coverage Complexity
NullPropertyResolver
0%
0/19
N/A
1
 
 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.el.ELContext;
 22  
 import javax.faces.context.FacesContext;
 23  
 import javax.faces.el.EvaluationException;
 24  
 import javax.faces.el.PropertyNotFoundException;
 25  
 import javax.faces.el.PropertyResolver;
 26  
 
 27  
 /**
 28  
  * Default PropertyResolver.  See JSF 1.2 spec section 5.8.2
 29  
  *
 30  
  * @author Stan Silvert
 31  
  */
 32  
 public final class NullPropertyResolver extends PropertyResolver {
 33  
     
 34  
     /** Creates a new instance of NullPropertyResolver */
 35  0
     public NullPropertyResolver() {
 36  0
     }
 37  
 
 38  
     public boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException {
 39  0
         elContext().setPropertyResolved(false);
 40  0
         return false;
 41  
     }
 42  
     
 43  
     public boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException {
 44  0
         elContext().setPropertyResolved(false);
 45  0
         return false;
 46  
     }
 47  
 
 48  
     public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException {
 49  0
         elContext().setPropertyResolved(false);
 50  0
         return null;
 51  
     }
 52  
     
 53  
     public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException {
 54  0
         elContext().setPropertyResolved(false);
 55  0
         return null;
 56  
     }
 57  
 
 58  
     public Class getType(Object base, int index) throws EvaluationException, PropertyNotFoundException {
 59  0
         elContext().setPropertyResolved(false);
 60  0
         return null;
 61  
     }
 62  
     
 63  
      public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException {
 64  0
         elContext().setPropertyResolved(false);
 65  0
         return null;
 66  
     }
 67  
 
 68  
     public void setValue(Object base, Object property, Object value) throws EvaluationException, PropertyNotFoundException {
 69  0
         elContext().setPropertyResolved(false);
 70  0
     }
 71  
 
 72  
     public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException {
 73  0
         elContext().setPropertyResolved(false);
 74  0
     }
 75  
 
 76  
     private ELContext elContext() {
 77  0
         return FacesContext.getCurrentInstance().getELContext();
 78  
     }
 79  
     
 80  
 }