| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.dozer.classmap; |
| 17 | |
|
| 18 | |
|
| 19 | |
import org.apache.commons.lang3.builder.ReflectionToStringBuilder; |
| 20 | |
import org.apache.commons.lang3.builder.ToStringStyle; |
| 21 | |
import org.dozer.util.MappingUtils; |
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
public class DozerClass { |
| 32 | |
|
| 33 | |
private String name; |
| 34 | |
private Class<?> classToMap; |
| 35 | |
private String beanFactory; |
| 36 | |
private String factoryBeanId; |
| 37 | |
private String mapGetMethod; |
| 38 | |
private String mapSetMethod; |
| 39 | |
private String createMethod; |
| 40 | |
private Boolean mapNull; |
| 41 | |
private Boolean mapEmptyString; |
| 42 | |
private Boolean accessible; |
| 43 | |
|
| 44 | 10964 | public DozerClass() { |
| 45 | 10964 | } |
| 46 | |
|
| 47 | |
public DozerClass(String name, Class<?> classToMap, String beanFactory, String factoryBeanId, String mapGetMethod, |
| 48 | 11716 | String mapSetMethod, String createMethod, Boolean mapNull, Boolean mapEmptyString, Boolean accessible) { |
| 49 | 11716 | this.name = name; |
| 50 | 11716 | this.classToMap = classToMap; |
| 51 | 11716 | this.beanFactory = beanFactory; |
| 52 | 11716 | this.factoryBeanId = factoryBeanId; |
| 53 | 11716 | this.mapGetMethod = mapGetMethod; |
| 54 | 11716 | this.mapSetMethod = mapSetMethod; |
| 55 | 11716 | this.createMethod = createMethod; |
| 56 | 11716 | this.mapNull = mapNull; |
| 57 | 11716 | this.mapEmptyString = mapEmptyString; |
| 58 | 11716 | this.accessible = accessible; |
| 59 | 11716 | } |
| 60 | |
|
| 61 | |
public String getBeanFactory() { |
| 62 | 242901 | return beanFactory; |
| 63 | |
} |
| 64 | |
|
| 65 | |
public void setBeanFactory(String beanFactory) { |
| 66 | 124 | this.beanFactory = beanFactory; |
| 67 | 124 | } |
| 68 | |
|
| 69 | |
public Class<?> getClassToMap() { |
| 70 | 1138419 | return classToMap; |
| 71 | |
} |
| 72 | |
|
| 73 | |
public String getName() { |
| 74 | 10988 | return name; |
| 75 | |
} |
| 76 | |
|
| 77 | |
public void setName(String name) { |
| 78 | 10964 | this.name = name; |
| 79 | 10964 | classToMap = MappingUtils.loadClass(name); |
| 80 | 10964 | } |
| 81 | |
|
| 82 | |
public String getFactoryBeanId() { |
| 83 | 183636 | return factoryBeanId; |
| 84 | |
} |
| 85 | |
|
| 86 | |
public void setFactoryBeanId(String factoryBeanId) { |
| 87 | 59 | this.factoryBeanId = factoryBeanId; |
| 88 | 59 | } |
| 89 | |
|
| 90 | |
public String getMapGetMethod() { |
| 91 | 137214 | return mapGetMethod; |
| 92 | |
} |
| 93 | |
|
| 94 | |
public void setMapGetMethod(String mapGetMethod) { |
| 95 | 282 | this.mapGetMethod = mapGetMethod; |
| 96 | 282 | } |
| 97 | |
|
| 98 | |
public String getMapSetMethod() { |
| 99 | 112856 | return mapSetMethod; |
| 100 | |
} |
| 101 | |
|
| 102 | |
public void setMapSetMethod(String mapSetMethod) { |
| 103 | 282 | this.mapSetMethod = mapSetMethod; |
| 104 | 282 | } |
| 105 | |
|
| 106 | |
public String getCreateMethod() { |
| 107 | 194430 | return createMethod; |
| 108 | |
} |
| 109 | |
|
| 110 | |
public void setCreateMethod(String createMethod) { |
| 111 | 10864 | this.createMethod = createMethod; |
| 112 | 10864 | } |
| 113 | |
|
| 114 | |
public Boolean getMapNull() { |
| 115 | 148903 | return mapNull; |
| 116 | |
} |
| 117 | |
|
| 118 | |
public void setMapNull(Boolean mapNull) { |
| 119 | 70 | this.mapNull = mapNull; |
| 120 | 70 | } |
| 121 | |
|
| 122 | |
public Boolean getMapEmptyString() { |
| 123 | 97935 | return mapEmptyString; |
| 124 | |
} |
| 125 | |
|
| 126 | |
public void setMapEmptyString(Boolean mapEmptyString) { |
| 127 | 70 | this.mapEmptyString = mapEmptyString; |
| 128 | 70 | } |
| 129 | |
|
| 130 | |
public boolean isMapTypeCustomGetterSetterClass() { |
| 131 | 25852 | return getMapGetMethod() != null || getMapSetMethod() != null; |
| 132 | |
} |
| 133 | |
|
| 134 | |
public Boolean isAccesible() { |
| 135 | 70277 | return accessible; |
| 136 | |
} |
| 137 | |
|
| 138 | |
public void setAccessible(Boolean accessible) { |
| 139 | 82 | this.accessible = accessible; |
| 140 | 82 | } |
| 141 | |
|
| 142 | |
@Override |
| 143 | |
public String toString() { |
| 144 | 0 | return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); |
| 145 | |
} |
| 146 | |
} |