Coverage Report - org.seasar.teeda.core.config.faces.assembler.FactoryChildAssembler
 
Classes in this File Line Coverage Branch Coverage Complexity
FactoryChildAssembler
100%
11/11
75%
3/4
1.5
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.config.faces.assembler;
 17  
 
 18  
 import java.util.Iterator;
 19  
 import java.util.LinkedList;
 20  
 import java.util.List;
 21  
 
 22  
 import javax.faces.FactoryFinder;
 23  
 
 24  
 /**
 25  
  * @author shot
 26  
  */
 27  
 public abstract class FactoryChildAssembler implements JsfAssembler {
 28  
 
 29  16
     private List factories_ = new LinkedList();
 30  
 
 31  16
     public FactoryChildAssembler() {
 32  16
     }
 33  
 
 34  
     public void setTargetFactories(List factories) {
 35  16
         if (factories != null) {
 36  16
             factories_.addAll(factories);
 37  
         }
 38  16
     }
 39  
 
 40  
     public void assemble() {
 41  16
         String factoryImplName = null;
 42  16
         for (Iterator itr = factories_.iterator(); itr.hasNext();) {
 43  13
             factoryImplName = (String) itr.next();
 44  13
             FactoryFinder.setFactory(getFactoryClassName(), factoryImplName);
 45  
         }
 46  16
     }
 47  
 
 48  
     protected abstract String getFactoryClassName();
 49  
 
 50  
 }