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.converters.CustomConverterContainer; |
22 | |
import org.dozer.util.DozerConstants; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 705 | public class Configuration { |
34 | |
|
35 | |
private Boolean wildcard; |
36 | |
private Boolean stopOnErrors; |
37 | |
private Boolean trimStrings; |
38 | |
private Boolean mapNull; |
39 | |
private Boolean mapEmptyString; |
40 | |
private String dateFormat; |
41 | |
private String beanFactory; |
42 | |
private RelationshipType relationshipType; |
43 | |
|
44 | 705 | private final CustomConverterContainer customConverters = new CustomConverterContainer(); |
45 | 705 | private final CopyByReferenceContainer copyByReferences = new CopyByReferenceContainer(); |
46 | 705 | private final AllowedExceptionContainer allowedExceptions = new AllowedExceptionContainer(); |
47 | |
|
48 | |
public AllowedExceptionContainer getAllowedExceptions() { |
49 | 5410 | return allowedExceptions; |
50 | |
} |
51 | |
|
52 | |
public CustomConverterContainer getCustomConverters() { |
53 | 684068 | return customConverters; |
54 | |
} |
55 | |
|
56 | |
public String getDateFormat() { |
57 | 50043 | return dateFormat; |
58 | |
} |
59 | |
|
60 | |
public void setDateFormat(String format) { |
61 | 135 | dateFormat = format; |
62 | 135 | } |
63 | |
|
64 | |
public Boolean getWildcard() { |
65 | 9505 | return wildcard != null ? wildcard : Boolean.valueOf(DozerConstants.DEFAULT_WILDCARD_POLICY); |
66 | |
} |
67 | |
|
68 | |
public void setWildcard(Boolean globalWildcardPolicy) { |
69 | 138 | wildcard = globalWildcardPolicy; |
70 | 138 | } |
71 | |
|
72 | |
public Boolean getStopOnErrors() { |
73 | 4968 | return stopOnErrors != null ? stopOnErrors : Boolean.valueOf(DozerConstants.DEFAULT_ERROR_POLICY); |
74 | |
} |
75 | |
|
76 | |
public void setStopOnErrors(Boolean stopOnErrors) { |
77 | 144 | this.stopOnErrors = stopOnErrors; |
78 | 144 | } |
79 | |
|
80 | |
public Boolean getMapNull() { |
81 | 920 | return mapNull != null ? mapNull : Boolean .valueOf(DozerConstants.DEFAULT_MAP_NULL_POLICY); |
82 | |
} |
83 | |
|
84 | |
public void setMapNull(Boolean globalMapNullPolicy) { |
85 | 1 | mapNull = globalMapNullPolicy; |
86 | 1 | } |
87 | |
|
88 | |
public Boolean getMapEmptyString() { |
89 | 920 | return mapEmptyString != null ? mapEmptyString : Boolean.valueOf(DozerConstants.DEFAULT_MAP_EMPTY_STRING_POLICY); |
90 | |
} |
91 | |
|
92 | |
public void setMapEmptyString(Boolean globalMapEmptyStringPolicy) { |
93 | 1 | mapEmptyString = globalMapEmptyStringPolicy; |
94 | 1 | } |
95 | |
|
96 | |
public String getBeanFactory() { |
97 | 242992 | return beanFactory; |
98 | |
} |
99 | |
|
100 | |
public void setBeanFactory(String beanFactory) { |
101 | 5 | this.beanFactory = beanFactory; |
102 | 5 | } |
103 | |
|
104 | |
public CopyByReferenceContainer getCopyByReferences() { |
105 | 82709 | return copyByReferences; |
106 | |
} |
107 | |
|
108 | |
public Boolean getTrimStrings() { |
109 | 94324 | return trimStrings != null ? trimStrings : Boolean.valueOf(DozerConstants.DEFAULT_TRIM_STRINGS_POLICY); |
110 | |
} |
111 | |
|
112 | |
public void setTrimStrings(Boolean trimStrings) { |
113 | 6 | this.trimStrings = trimStrings; |
114 | 6 | } |
115 | |
|
116 | |
public RelationshipType getRelationshipType() { |
117 | 62666 | return relationshipType; |
118 | |
} |
119 | |
|
120 | |
public void setRelationshipType(RelationshipType relationshipType) { |
121 | 2 | this.relationshipType = relationshipType; |
122 | 2 | } |
123 | |
|
124 | |
@Override |
125 | |
public String toString() { |
126 | 0 | return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); |
127 | |
} |
128 | |
} |