Coverage Report - org.apache.tapestry5.internal.SyntheticModuleDef
 
Classes in this File Line Coverage Branch Coverage Complexity
SyntheticModuleDef
78%
7/9
N/A
0
 
 1  
 // Copyright 2007 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry5.internal;
 16  
 
 17  
 import org.apache.tapestry5.ioc.def.ContributionDef;
 18  
 import org.apache.tapestry5.ioc.def.DecoratorDef;
 19  
 import org.apache.tapestry5.ioc.def.ModuleDef;
 20  
 import org.apache.tapestry5.ioc.def.ServiceDef;
 21  
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 22  
 
 23  
 import java.util.Collections;
 24  
 import java.util.Set;
 25  
 
 26  
 /**
 27  
  * A synthetic module definition, used to mix in some additional "pre-built" service configuration contributions.
 28  
  */
 29  
 public class SyntheticModuleDef implements ModuleDef
 30  
 {
 31  
     private final Set<ContributionDef> contributionDefs;
 32  
 
 33  
     public SyntheticModuleDef(ContributionDef... contributionDefs)
 34  64
     {
 35  64
         this.contributionDefs = CollectionFactory.newSet(contributionDefs);
 36  64
     }
 37  
 
 38  
     /**
 39  
      * Returns null.
 40  
      */
 41  
     public Class getBuilderClass()
 42  
     {
 43  0
         return null;
 44  
     }
 45  
 
 46  
     /**
 47  
      * Returns the configured set.
 48  
      */
 49  
     public Set<ContributionDef> getContributionDefs()
 50  
     {
 51  1722
         return contributionDefs;
 52  
     }
 53  
 
 54  
     /**
 55  
      * Returns an empty set.
 56  
      */
 57  
     public Set<DecoratorDef> getDecoratorDefs()
 58  
     {
 59  3908
         return Collections.emptySet();
 60  
     }
 61  
 
 62  
     /**
 63  
      * Returns "SyntheticModule".
 64  
      */
 65  
     public String getLoggerName()
 66  
     {
 67  64
         return "SyntheticModule";
 68  
     }
 69  
 
 70  
     /**
 71  
      * Returns null.
 72  
      */
 73  
     public ServiceDef getServiceDef(String serviceId)
 74  
     {
 75  0
         return null;
 76  
     }
 77  
 
 78  
     /**
 79  
      * Returns an empty set.
 80  
      */
 81  
     public Set<String> getServiceIds()
 82  
     {
 83  128
         return Collections.emptySet();
 84  
     }
 85  
 }