Coverage Report - org.dozer.factory.BeanCreationDirective
 
Classes in this File Line Coverage Branch Coverage Complexity
BeanCreationDirective
88%
31/35
50%
1/2
1.118
 
 1  
 /**
 2  
  * Copyright 2005-2013 Dozer Project
 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, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.dozer.factory;
 17  
 
 18  
 public class BeanCreationDirective {
 19  
 
 20  
   private Object srcObject;
 21  
   private Class<?> srcClass;
 22  
   private Class<?> targetClass;
 23  
   private Class<?> alternateClass;
 24  
   private String factoryName;
 25  
   private String factoryId;
 26  
   private String createMethod;
 27  
 
 28  16
   public BeanCreationDirective() {
 29  16
   }
 30  
 
 31  304158
   public BeanCreationDirective(Object srcObject, Class<?> srcClass, Class<?> targetClass, Class<?> alternateClass, String factoryName, String factoryId, String createMethod) {
 32  304158
     this.srcObject = srcObject;
 33  304158
     this.srcClass = srcClass;
 34  304158
     this.targetClass = targetClass;
 35  304158
     this.alternateClass = alternateClass;
 36  304158
     this.factoryName = factoryName;
 37  304158
     this.factoryId = factoryId;
 38  304158
     this.createMethod = createMethod;
 39  304158
   }
 40  
 
 41  
   public Object getSrcObject() {
 42  50
     return srcObject;
 43  
   }
 44  
 
 45  
   public Class<?> getSrcClass() {
 46  50
     return srcClass;
 47  
   }
 48  
 
 49  
   public Class<?> getTargetClass() {
 50  0
     return targetClass;
 51  
   }
 52  
 
 53  
   public Class<?> getAlternateClass() {
 54  25
     return alternateClass;
 55  
   }
 56  
 
 57  
   public String getFactoryName() {
 58  172923
     return factoryName;
 59  
   }
 60  
 
 61  
   public String getFactoryId() {
 62  51
     return factoryId;
 63  
   }
 64  
 
 65  
   public String getCreateMethod() {
 66  172974
     return createMethod;
 67  
   }
 68  
 
 69  
   public void setSrcObject(Object srcObject) {
 70  1
     this.srcObject = srcObject;
 71  1
   }
 72  
 
 73  
   public void setSrcClass(Class<?> srcClass) {
 74  1
     this.srcClass = srcClass;
 75  1
   }
 76  
 
 77  
   public void setTargetClass(Class<?> targetClass) {
 78  20
     this.targetClass = targetClass;
 79  20
   }
 80  
 
 81  
   public void setAlternateClass(Class<?> alternateClass) {
 82  0
     this.alternateClass = alternateClass;
 83  0
   }
 84  
 
 85  
   public void setFactoryName(String factoryName) {
 86  6
     this.factoryName = factoryName;
 87  6
   }
 88  
 
 89  
   public void setFactoryId(String factoryId) {
 90  1
     this.factoryId = factoryId;
 91  1
   }
 92  
 
 93  
   public void setCreateMethod(String createMethod) {
 94  11
     this.createMethod = createMethod;
 95  11
   }
 96  
 
 97  
   public Class<?> getActualClass() {
 98  864699
     if (targetClass != null) {
 99  864699
       return targetClass;
 100  
     } else {
 101  0
       return alternateClass;
 102  
     }
 103  
   }
 104  
 
 105  
 }