Coverage Report - org.apache.myfaces.config.impl.digester.elements.ContractMappingImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ContractMappingImpl
0%
0/21
0%
0/12
2.333
 
 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.ArrayList;
 22  
 import java.util.Collections;
 23  
 import java.util.List;
 24  
 import org.apache.myfaces.config.element.ContractMapping;
 25  
 
 26  
 /**
 27  
  *
 28  
  * @author lu4242
 29  
  */
 30  0
 public class ContractMappingImpl extends ContractMapping
 31  
 {
 32  
     private List<String> urlPatternList;
 33  
     private List<String> contractsList;
 34  
     
 35  
     private transient List <String> unmodifiableUrlPatternList;
 36  
     private transient List <String> unmodifiableContractsList;
 37  
 
 38  
     /**
 39  
      * @return the urlPattern
 40  
      */
 41  
     public List<String> getUrlPatternList()
 42  
     {
 43  0
         if (urlPatternList == null)
 44  
         {
 45  0
             return Collections.emptyList();
 46  
         }
 47  0
         if (unmodifiableUrlPatternList == null)
 48  
         {
 49  0
             unmodifiableUrlPatternList = 
 50  
                 Collections.unmodifiableList(urlPatternList);
 51  
         }
 52  0
         return unmodifiableUrlPatternList;
 53  
     }
 54  
 
 55  
     /**
 56  
      * @return the contracts
 57  
      */
 58  
     public List<String> getContractList()
 59  
     {
 60  0
         if (contractsList == null)
 61  
         {
 62  0
             return Collections.emptyList();
 63  
         }
 64  0
         if (unmodifiableContractsList == null)
 65  
         {
 66  0
             unmodifiableContractsList = 
 67  
                 Collections.unmodifiableList(contractsList);
 68  
         }
 69  0
         return unmodifiableContractsList;
 70  
     }
 71  
 
 72  
     public void addContract(String contract)
 73  
     {
 74  0
         if (contractsList == null)
 75  
         {
 76  0
             contractsList = new ArrayList<String>();
 77  
         }
 78  0
         contractsList.add(contract);
 79  0
     }
 80  
     
 81  
     public void addUrlPattern(String urlPattern)
 82  
     {
 83  0
         if (urlPatternList == null)
 84  
         {
 85  0
             urlPatternList = new ArrayList<String>();
 86  
         }
 87  0
         urlPatternList.add(urlPattern);
 88  0
     }
 89  
 
 90  
     @Override
 91  
     public String getUrlPattern()
 92  
     {
 93  0
         return null;
 94  
     }
 95  
 
 96  
     @Override
 97  
     public String getContracts()
 98  
     {
 99  0
         return null;
 100  
     }
 101  
 }