Coverage Report - org.seasar.teeda.core.config.faces.assembler.impl.DefaultLifecycleAssembler
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultLifecycleAssembler
100%
11/11
100%
2/2
1.333
 
 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.impl;
 17  
 
 18  
 import java.util.Iterator;
 19  
 import java.util.LinkedList;
 20  
 import java.util.List;
 21  
 
 22  
 import org.seasar.teeda.core.config.faces.assembler.LifecycleAssembler;
 23  
 import org.seasar.teeda.core.config.faces.assembler.LifecycleChildAssembler;
 24  
 import org.seasar.teeda.core.config.faces.element.LifecycleElement;
 25  
 import org.seasar.teeda.core.util.IteratorUtil;
 26  
 
 27  
 /**
 28  
  * @author shot
 29  
  */
 30  
 public class DefaultLifecycleAssembler extends LifecycleAssembler {
 31  
 
 32  
     private LifecycleChildAssembler child_;
 33  
 
 34  
     public DefaultLifecycleAssembler(List lifecycles) {
 35  2
         super(lifecycles);
 36  2
     }
 37  
 
 38  
     protected void setupBeforeAssemble() {
 39  2
         List targets = new LinkedList();
 40  2
         for (Iterator itr = IteratorUtil.getIterator(getLifecycles()); itr
 41  4
                 .hasNext();) {
 42  2
             LifecycleElement element = (LifecycleElement) itr.next();
 43  2
             targets.addAll(element.getPhaseListeners());
 44  
         }
 45  2
         child_ = new PhaseListenerAssembler(targets);
 46  2
     }
 47  
 
 48  
     public void assemble() {
 49  2
         child_.assemble();
 50  2
     }
 51  
 
 52  
 }