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