Coverage Report - org.apache.myfaces.config.impl.digester.elements.AttributeImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
AttributeImpl
0%
0/41
0%
0/16
1.75
 
 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.config.impl.digester.elements;
 20  
 
 21  
 import java.io.Serializable;
 22  
 import java.util.ArrayList;
 23  
 import java.util.Collection;
 24  
 import java.util.Collections;
 25  
 import java.util.List;
 26  
 
 27  
 /**
 28  
  * @author Martin Marinschek
 29  
  * @version $Revision$ $Date$
 30  
  *
 31  
      The "attribute" element represents a named, typed, value associated with
 32  
      the parent UIComponent via the generic attributes mechanism.
 33  
 
 34  
      Attribute names must be unique within the scope of the parent (or related)
 35  
      component.
 36  
 
 37  
      <!ELEMENT attribute       (description*, display-name*, icon*, attribute-name,
 38  
 attribute-class, default-value?, suggested-value?, attribute-extension*)>
 39  
 
 40  
  *          <p/>
 41  
  */
 42  0
 public class AttributeImpl extends org.apache.myfaces.config.element.Attribute implements Serializable
 43  
 {
 44  
     private List<String> _description;
 45  
     private List<String> _displayName;
 46  
     private List<String> _icon;
 47  
     private String _attributeName;
 48  
     private String _attributeClass;
 49  
     private String _defaultValue;
 50  
     private String _suggestedValue;
 51  
     private List<String> _attributeExtension;
 52  
 
 53  
 
 54  
     public void addDescription(String value)
 55  
     {
 56  0
         if(_description == null)
 57  
         {
 58  0
             _description = new ArrayList<String>();
 59  
         }
 60  
         
 61  0
         _description.add(value);
 62  0
     }
 63  
 
 64  
     public Collection<? extends String> getDescriptions()
 65  
     {
 66  0
         if(_description == null)
 67  
         {
 68  0
             return Collections.emptyList();
 69  
         }
 70  
         
 71  0
         return _description;
 72  
     }
 73  
 
 74  
     public void addDisplayName(String value)
 75  
     {
 76  0
         if(_displayName == null)
 77  
         {
 78  0
             _displayName = new ArrayList<String>();
 79  
         }
 80  
 
 81  0
         _displayName.add(value);
 82  0
     }
 83  
 
 84  
     public Collection<? extends String> getDisplayNames()
 85  
     {
 86  0
         if(_displayName == null)
 87  
         {
 88  0
             return Collections.emptyList();
 89  
         }
 90  
         
 91  0
         return _displayName;
 92  
     }
 93  
 
 94  
     public void addIcon(String value)
 95  
     {
 96  0
         if(_icon == null)
 97  
         {
 98  0
             _icon = new ArrayList<String>();
 99  
         }
 100  
         
 101  0
         _icon.add(value);
 102  0
     }
 103  
 
 104  
     public Collection<? extends String> getIcons()
 105  
     {
 106  0
         if(_icon == null)
 107  
         {
 108  0
             return Collections.emptyList();
 109  
         }
 110  
 
 111  0
         return _icon;
 112  
     }
 113  
 
 114  
     public void setAttributeName(String attributeName)
 115  
     {
 116  0
         _attributeName = attributeName;
 117  0
     }
 118  
 
 119  
     public String getAttributeName()
 120  
     {
 121  0
         return _attributeName;
 122  
     }
 123  
 
 124  
     public void setAttributeClass(String attributeClass)
 125  
     {
 126  0
         _attributeClass = attributeClass;
 127  0
     }
 128  
 
 129  
     public String getAttributeClass()
 130  
     {
 131  0
         return _attributeClass;
 132  
     }
 133  
 
 134  
     public void setDefaultValue(String defaultValue)
 135  
     {
 136  0
         _defaultValue = defaultValue;
 137  0
     }
 138  
 
 139  
     public String getDefaultValue()
 140  
     {
 141  0
         return _defaultValue;
 142  
     }
 143  
 
 144  
     public void setSuggestedValue(String suggestedValue)
 145  
     {
 146  0
         _suggestedValue = suggestedValue;
 147  0
     }
 148  
 
 149  
     public String getSuggestedValue()
 150  
     {
 151  0
         return _suggestedValue;
 152  
     }
 153  
 
 154  
     public void addAttributeExtension(String attributeExtension)
 155  
     {
 156  0
         if(_attributeExtension == null)
 157  
         {
 158  0
             _attributeExtension = new ArrayList<String>();
 159  
         }
 160  
 
 161  0
         _attributeExtension.add(attributeExtension);
 162  0
     }
 163  
 
 164  
     public Collection<? extends String> getAttributeExtensions()
 165  
     {
 166  0
         if(_attributeExtension == null)
 167  
         {
 168  0
             return Collections.emptyList();
 169  
         }
 170  
 
 171  0
         return _attributeExtension;
 172  
     }
 173  
 }