Coverage Report - org.seasar.teeda.core.config.faces.assembler.ApplicationChildAssembler
 
Classes in this File Line Coverage Branch Coverage Complexity
ApplicationChildAssembler
81%
13/16
50%
4/8
2.2
 
 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 javax.faces.application.Application;
 19  
 
 20  
 import org.seasar.teeda.core.util.MarshalUtil;
 21  
 
 22  
 /**
 23  
  * @author shot
 24  
  */
 25  
 public abstract class ApplicationChildAssembler implements JsfAssembler {
 26  
 
 27  
     private Application application_;
 28  
 
 29  
     private String targetName_;
 30  
 
 31  39
     public ApplicationChildAssembler(String targetName, Application application) {
 32  39
         if (targetName == null || targetName.equals("")) {
 33  0
             throw new IllegalArgumentException("targetName");
 34  
         }
 35  39
         if (application == null) {
 36  0
             throw new IllegalArgumentException("application");
 37  
         }
 38  39
         application_ = application;
 39  39
         targetName_ = targetName;
 40  39
     }
 41  
 
 42  4
     public ApplicationChildAssembler(Application application) {
 43  4
         if (application == null) {
 44  0
             throw new IllegalArgumentException("application");
 45  
         }
 46  4
         application_ = application;
 47  4
     }
 48  
 
 49  
     protected Object createMarshalInstance(Class clazz, Object previous) {
 50  31
         return MarshalUtil.createMarshalInstance(targetName_, clazz, previous);
 51  
     }
 52  
 
 53  
     protected final Application getApplication() {
 54  78
         return application_;
 55  
     }
 56  
 
 57  
     protected final String getTargetName() {
 58  8
         return targetName_;
 59  
     }
 60  
 }