Coverage Report - org.apache.myfaces.view.facelets.el.ResourceLocationValueExpression
 
Classes in this File Line Coverage Branch Coverage Complexity
ResourceLocationValueExpression
0%
0/28
N/A
1.273
 
 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.view.facelets.el;
 20  
 
 21  
 import javax.el.ELContext;
 22  
 import javax.el.ValueExpression;
 23  
 import javax.faces.FacesWrapper;
 24  
 import javax.faces.context.FacesContext;
 25  
 import javax.faces.view.Location;
 26  
 
 27  
 /**
 28  
  * 
 29  
  * @author Leonardo Uribe 
 30  
  */
 31  0
 public class ResourceLocationValueExpression extends LocationValueExpression implements FacesWrapper<ValueExpression>
 32  
 {
 33  
     
 34  
     private static final long serialVersionUID = -5636849184764526288L;
 35  
     
 36  
     public ResourceLocationValueExpression()
 37  
     {
 38  0
         super();
 39  0
     }
 40  
     
 41  
     public ResourceLocationValueExpression(Location location, ValueExpression delegate)
 42  
     {
 43  0
         super(location, delegate);
 44  0
     }
 45  
     
 46  
     @Override
 47  
     public Class<?> getType(ELContext context)
 48  
     {
 49  0
         FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
 50  0
         ResourceELUtils.saveResourceLocationForResolver(facesContext, location);
 51  
         try
 52  
         {
 53  0
             return delegate.getType(context);
 54  
         }
 55  
         finally
 56  
         {
 57  0
             ResourceELUtils.removeResourceLocationForResolver(facesContext);
 58  
         }
 59  
     }
 60  
 
 61  
     @Override
 62  
     public Object getValue(ELContext context)
 63  
     {
 64  0
         FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
 65  0
         ResourceELUtils.saveResourceLocationForResolver(facesContext, location);
 66  
         try
 67  
         {
 68  0
             return delegate.getValue(context);
 69  
         }
 70  
         finally
 71  
         {
 72  0
             ResourceELUtils.removeResourceLocationForResolver(facesContext);
 73  
         }
 74  
     }
 75  
 
 76  
     @Override
 77  
     public boolean isReadOnly(ELContext context)
 78  
     {
 79  0
         FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
 80  0
         ResourceELUtils.saveResourceLocationForResolver(facesContext, location);
 81  
         try
 82  
         {
 83  0
             return delegate.isReadOnly(context);
 84  
         }
 85  
         finally
 86  
         {
 87  0
             ResourceELUtils.removeResourceLocationForResolver(facesContext);
 88  
         }
 89  
     }
 90  
 
 91  
     @Override
 92  
     public void setValue(ELContext context, Object value)
 93  
     {
 94  0
         FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
 95  0
         ResourceELUtils.saveResourceLocationForResolver(facesContext, location);
 96  
         try
 97  
         {
 98  0
             delegate.setValue(context, value);
 99  
         }
 100  
         finally
 101  
         {
 102  0
             ResourceELUtils.removeResourceLocationForResolver(facesContext);
 103  0
         }
 104  0
     }
 105  
 
 106  
     @Override
 107  
     public boolean equals(Object obj)
 108  
     {
 109  0
         return delegate.equals(obj);
 110  
     }
 111  
 
 112  
     @Override
 113  
     public String getExpressionString()
 114  
     {
 115  0
         return delegate.getExpressionString();
 116  
     }
 117  
 
 118  
     @Override
 119  
     public int hashCode()
 120  
     {
 121  0
         return delegate.hashCode();
 122  
     }
 123  
 
 124  
     @Override
 125  
     public boolean isLiteralText()
 126  
     {
 127  0
         return delegate.isLiteralText();
 128  
     }
 129  
 
 130  
     public ValueExpression getWrapped()
 131  
     {
 132  0
         return delegate;
 133  
     }
 134  
 }