| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.dozer.fieldmap; |
| 17 | |
|
| 18 | |
import org.apache.commons.lang3.builder.ReflectionToStringBuilder; |
| 19 | |
import org.apache.commons.lang3.builder.ToStringStyle; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
public class DozerField implements Cloneable { |
| 31 | |
|
| 32 | |
private String type; |
| 33 | |
private String name; |
| 34 | |
private String dateFormat; |
| 35 | |
private String theGetMethod; |
| 36 | |
private String theSetMethod; |
| 37 | |
private String key; |
| 38 | |
private String mapSetMethod; |
| 39 | |
private String mapGetMethod; |
| 40 | |
private Boolean accessible; |
| 41 | |
private String createMethod; |
| 42 | |
private boolean indexed; |
| 43 | 100729 | private int index = -1; |
| 44 | |
|
| 45 | 100729 | public DozerField(String name, String type) { |
| 46 | 100729 | this.type = type; |
| 47 | 100729 | this.name = name; |
| 48 | 100729 | } |
| 49 | |
|
| 50 | |
public void setType(String type) { |
| 51 | 1 | this.type = type; |
| 52 | 1 | } |
| 53 | |
|
| 54 | |
public String getType() { |
| 55 | 221029 | return type; |
| 56 | |
} |
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
public String getName() { |
| 63 | 1187718 | return name; |
| 64 | |
} |
| 65 | |
|
| 66 | |
public String getDateFormat() { |
| 67 | 92522 | return dateFormat; |
| 68 | |
} |
| 69 | |
|
| 70 | |
public void setDateFormat(String dateFormat) { |
| 71 | 276 | this.dateFormat = dateFormat; |
| 72 | 276 | } |
| 73 | |
|
| 74 | |
public String getTheGetMethod() { |
| 75 | 83819 | return theGetMethod; |
| 76 | |
} |
| 77 | |
|
| 78 | |
public void setTheGetMethod(String theGetMethod) { |
| 79 | 710 | this.theGetMethod = theGetMethod; |
| 80 | 710 | } |
| 81 | |
|
| 82 | |
public String getTheSetMethod() { |
| 83 | 83487 | return theSetMethod; |
| 84 | |
} |
| 85 | |
|
| 86 | |
public void setTheSetMethod(String theSetMethod) { |
| 87 | 3618 | this.theSetMethod = theSetMethod; |
| 88 | 3618 | } |
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
public String getKey() { |
| 95 | 503317 | return key; |
| 96 | |
} |
| 97 | |
|
| 98 | |
public void setKey(String key) { |
| 99 | 20321 | this.key = key; |
| 100 | 20321 | } |
| 101 | |
|
| 102 | |
public String getMapGetMethod() { |
| 103 | 87448 | return mapGetMethod; |
| 104 | |
} |
| 105 | |
|
| 106 | |
public void setMapGetMethod(String mapGetMethod) { |
| 107 | 5346 | this.mapGetMethod = mapGetMethod; |
| 108 | 5346 | } |
| 109 | |
|
| 110 | |
public String getMapSetMethod() { |
| 111 | 86038 | return mapSetMethod; |
| 112 | |
} |
| 113 | |
|
| 114 | |
public void setMapSetMethod(String mapSetMethod) { |
| 115 | 5326 | this.mapSetMethod = mapSetMethod; |
| 116 | 5326 | } |
| 117 | |
|
| 118 | |
public Boolean isAccessible() { |
| 119 | 59806 | return accessible; |
| 120 | |
} |
| 121 | |
|
| 122 | |
public void setAccessible(Boolean isAccessible) { |
| 123 | 402 | this.accessible = isAccessible; |
| 124 | 402 | } |
| 125 | |
|
| 126 | |
public String getCreateMethod() { |
| 127 | 40807 | return createMethod; |
| 128 | |
} |
| 129 | |
|
| 130 | |
public void setCreateMethod(String createMethod) { |
| 131 | 86 | this.createMethod = createMethod; |
| 132 | 86 | } |
| 133 | |
|
| 134 | |
public int getIndex() { |
| 135 | 59940 | return index; |
| 136 | |
} |
| 137 | |
|
| 138 | |
public void setIndex(int index) { |
| 139 | 432 | this.index = index; |
| 140 | 432 | } |
| 141 | |
|
| 142 | |
public boolean isIndexed() { |
| 143 | 515991 | return indexed; |
| 144 | |
} |
| 145 | |
|
| 146 | |
public void setIndexed(boolean isIndexed) { |
| 147 | 432 | this.indexed = isIndexed; |
| 148 | 432 | } |
| 149 | |
|
| 150 | |
public void setName(String name) { |
| 151 | 4595 | this.name = name; |
| 152 | 4595 | } |
| 153 | |
|
| 154 | |
public boolean isCustomGetterSetterField() { |
| 155 | 24944 | return getTheGetMethod() != null || getTheSetMethod() != null; |
| 156 | |
} |
| 157 | |
|
| 158 | |
public boolean isMapTypeCustomGetterSetterField() { |
| 159 | 26908 | return getMapGetMethod() != null || getMapSetMethod() != null; |
| 160 | |
} |
| 161 | |
|
| 162 | |
@Override |
| 163 | |
public String toString() { |
| 164 | 0 | return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); |
| 165 | |
} |
| 166 | |
|
| 167 | |
@Override |
| 168 | |
protected Object clone() throws CloneNotSupportedException { |
| 169 | 27437 | return super.clone(); |
| 170 | |
} |
| 171 | |
|
| 172 | |
} |