Coverage Report - javax.faces.component._PassThroughAttributesMap
 
Classes in this File Line Coverage Branch Coverage Complexity
_PassThroughAttributesMap
0%
0/27
0%
0/6
1.188
 
 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 javax.faces.component;
 20  
 
 21  
 import java.io.Serializable;
 22  
 import java.util.Collection;
 23  
 import java.util.Collections;
 24  
 import java.util.Map;
 25  
 import java.util.Set;
 26  
 
 27  0
 class _PassThroughAttributesMap implements Map<String, Object>, Serializable
 28  
 {
 29  
     private static final long serialVersionUID = -9106932179394257866L;
 30  
     
 31  
     private UIComponentBase _component;
 32  
     
 33  
     _PassThroughAttributesMap(UIComponentBase component)
 34  0
     {
 35  0
         _component = component;
 36  0
     }
 37  
 
 38  
     
 39  
     /**
 40  
      * Return the map containing the attributes.
 41  
      * <p/>
 42  
      * This method is package-scope so that the UIComponentBase class can access it
 43  
      * directly when serializing the component.
 44  
      */
 45  
     Map<String, Object> getUnderlyingMap()
 46  
     {
 47  0
         StateHelper stateHelper = _component.getStateHelper(false);
 48  0
         Map<String, Object> attributes = null;
 49  0
         if (stateHelper != null)
 50  
         {
 51  0
             attributes = (Map<String, Object>) stateHelper.get(UIComponentBase.PropertyKeys.passThroughAttributesMap);
 52  
         }
 53  0
         return attributes == null ? Collections.EMPTY_MAP : attributes;
 54  
     }
 55  
     
 56  
     @Override
 57  
     public boolean equals(Object obj)
 58  
     {
 59  0
         return getUnderlyingMap().equals(obj);
 60  
     }
 61  
 
 62  
     @Override
 63  
     public int hashCode()
 64  
     {
 65  0
         return getUnderlyingMap().hashCode();
 66  
     }
 67  
 
 68  
     public int size()
 69  
     {
 70  0
         return getUnderlyingMap().size();
 71  
     }
 72  
 
 73  
     public boolean isEmpty()
 74  
     {
 75  0
         return getUnderlyingMap().isEmpty();
 76  
     }
 77  
 
 78  
     public boolean containsKey(Object key)
 79  
     {
 80  0
         return getUnderlyingMap().containsKey(key);
 81  
     }
 82  
 
 83  
     public boolean containsValue(Object value)
 84  
     {
 85  0
         return getUnderlyingMap().containsValue(value);
 86  
     }
 87  
 
 88  
     public Object get(Object key)
 89  
     {
 90  0
         return getUnderlyingMap().get(key);
 91  
     }
 92  
 
 93  
     public Object put(String key, Object value)
 94  
     {
 95  0
         return _component.getStateHelper().put(
 96  
             UIComponentBase.PropertyKeys.passThroughAttributesMap, key, value);
 97  
     }
 98  
 
 99  
     public Object remove(Object key)
 100  
     {
 101  0
         return _component.getStateHelper().remove(
 102  
             UIComponentBase.PropertyKeys.passThroughAttributesMap, key);
 103  
     }
 104  
 
 105  
     /**
 106  
      * Call put(key, value) for each entry in the provided map.
 107  
      */
 108  
     public void putAll(Map<? extends String, ?> t)
 109  
     {
 110  0
         for (Map.Entry<? extends String, ?> entry : t.entrySet())
 111  
         {
 112  0
             put(entry.getKey(), entry.getValue());
 113  0
         }
 114  0
     }
 115  
 
 116  
     /**
 117  
      * Return a set of all <i>attributes</i>. Properties of the underlying
 118  
      * UIComponent are not included, nor value-bindings.
 119  
      */
 120  
     public Set<Map.Entry<String, Object>> entrySet()
 121  
     {
 122  0
         return getUnderlyingMap().entrySet();
 123  
     }
 124  
 
 125  
     public Set<String> keySet()
 126  
     {
 127  0
         return getUnderlyingMap().keySet();
 128  
     }
 129  
 
 130  
     public void clear()
 131  
     {
 132  0
         getUnderlyingMap().clear();
 133  0
     }
 134  
 
 135  
     public Collection<Object> values()
 136  
     {
 137  0
         return getUnderlyingMap().values();
 138  
     }
 139  
 }