1 package org.bremersee.ldaptive.transcoder;
2
3 import org.ldaptive.ad.transcode.DeltaTimeValueTranscoder;
4 import org.ldaptive.ad.transcode.FileTimeValueTranscoder;
5 import org.ldaptive.ad.transcode.UnicodePwdValueTranscoder;
6 import org.ldaptive.dn.DefaultAttributeValueEscaper;
7 import org.ldaptive.dn.DefaultRDnNormalizer;
8 import org.ldaptive.schema.transcode.AttributeTypeValueTranscoder;
9 import org.ldaptive.transcode.BigIntegerValueTranscoder;
10 import org.ldaptive.transcode.BooleanValueTranscoder;
11 import org.ldaptive.transcode.ByteArrayValueTranscoder;
12 import org.ldaptive.transcode.DoubleValueTranscoder;
13 import org.ldaptive.transcode.FloatValueTranscoder;
14 import org.ldaptive.transcode.GeneralizedTimeValueTranscoder;
15 import org.ldaptive.transcode.IntegerValueTranscoder;
16 import org.ldaptive.transcode.LongValueTranscoder;
17 import org.ldaptive.transcode.ShortValueTranscoder;
18 import org.ldaptive.transcode.StringValueTranscoder;
19 import org.ldaptive.transcode.UUIDValueTranscoder;
20
21
22
23
24 public abstract class ValueTranscoderFactory {
25
26 private static AttributeTypeValueTranscoder attributeTypeValueTranscoder;
27
28 private static BigIntegerValueTranscoder bigIntegerValueTranscoder;
29
30 private static BooleanValueTranscoder booleanValueTranscoder;
31
32 private static BooleanValueTranscoder booleanPrimitiveValueTranscoder;
33
34 private static ByteArrayValueTranscoder byteArrayValueTranscoder;
35
36 private static DeltaTimeValueTranscoder deltaTimeValueTranscoder;
37
38 private static DnValueTranscoder dnValueTranscoder;
39
40 private static DnValueTranscoder dnValueTranscoderCaseSensitive;
41
42 private static DoubleValueTranscoder doubleValueTranscoder;
43
44 private static DoubleValueTranscoder doublePrimitiveValueTranscoder;
45
46 private static FileTimeValueTranscoder fileTimeValueTranscoder;
47
48 private static FileTimeToOffsetDateTimeValueTranscoder fileTimeToOffsetDateTimeValueTranscoder;
49
50 private static FloatValueTranscoder floatValueTranscoder;
51
52 private static FloatValueTranscoder floatPrimitiveValueTranscoder;
53
54 private static GeneralizedTimeValueTranscoder generalizedTimeValueTranscoder;
55
56 private static GeneralizedTimeToOffsetDateTimeValueTranscoder
57 generalizedTimeToOffsetDateTimeValueTranscoder;
58
59 private static IntegerValueTranscoder integerValueTranscoder;
60
61 private static IntegerValueTranscoder integerPrimitiveValueTranscoder;
62
63 private static LongValueTranscoder longValueTranscoder;
64
65 private static LongValueTranscoder longValuePrimitiveTranscoder;
66
67 private static ShortValueTranscoder shortValueTranscoder;
68
69 private static ShortValueTranscoder shortPrimitiveValueTranscoder;
70
71 private static StringValueTranscoder stringValueTranscoder;
72
73 private static UserAccountControlValueTranscoder userAccountControlValueTranscoder;
74
75 private static UUIDValueTranscoder uuidValueTranscoder;
76
77 private static UnicodePwdValueTranscoder unicodePwdValueTranscoder;
78
79
80
81
82 private ValueTranscoderFactory() {
83 super();
84 }
85
86
87
88
89
90
91 public static AttributeTypeValueTranscoder getAttributeTypeValueTranscoder() {
92 if (attributeTypeValueTranscoder == null) {
93 attributeTypeValueTranscoder = new AttributeTypeValueTranscoder();
94 }
95 return attributeTypeValueTranscoder;
96 }
97
98
99
100
101
102
103 public static BigIntegerValueTranscoder getBigIntegerValueTranscoder() {
104 if (bigIntegerValueTranscoder == null) {
105 bigIntegerValueTranscoder = new BigIntegerValueTranscoder();
106 }
107 return bigIntegerValueTranscoder;
108 }
109
110
111
112
113
114
115 public static BooleanValueTranscoder getBooleanValueTranscoder() {
116 if (booleanValueTranscoder == null) {
117 booleanValueTranscoder = new BooleanValueTranscoder(false);
118 }
119 return booleanValueTranscoder;
120 }
121
122
123
124
125
126
127 public static BooleanValueTranscoder getBooleanPrimitiveValueTranscoder() {
128 if (booleanPrimitiveValueTranscoder == null) {
129 booleanPrimitiveValueTranscoder = new BooleanValueTranscoder(true);
130 }
131 return booleanPrimitiveValueTranscoder;
132 }
133
134
135
136
137
138
139 public static ByteArrayValueTranscoder getByteArrayValueTranscoder() {
140 if (byteArrayValueTranscoder == null) {
141 byteArrayValueTranscoder = new ByteArrayValueTranscoder();
142 }
143 return byteArrayValueTranscoder;
144 }
145
146
147
148
149
150
151 public static DeltaTimeValueTranscoder getDeltaTimeValueTranscoder() {
152 if (deltaTimeValueTranscoder == null) {
153 deltaTimeValueTranscoder = new DeltaTimeValueTranscoder();
154 }
155 return deltaTimeValueTranscoder;
156 }
157
158
159
160
161
162
163 public static DnValueTranscoder getDnValueTranscoder() {
164 if (dnValueTranscoder == null) {
165 dnValueTranscoder = new DnValueTranscoder();
166 }
167 return dnValueTranscoder;
168 }
169
170
171
172
173
174
175 public static DnValueTranscoder getDnValueTranscoderCaseSensitive() {
176 if (dnValueTranscoderCaseSensitive == null) {
177 dnValueTranscoderCaseSensitive = new DnValueTranscoder(
178 new DefaultRDnNormalizer(
179 new DefaultAttributeValueEscaper(),
180 name -> name,
181 value -> value));
182 }
183 return dnValueTranscoderCaseSensitive;
184 }
185
186
187
188
189
190
191 public static DoubleValueTranscoder getDoubleValueTranscoder() {
192 if (doubleValueTranscoder == null) {
193 doubleValueTranscoder = new DoubleValueTranscoder(false);
194 }
195 return doubleValueTranscoder;
196 }
197
198
199
200
201
202
203 public static DoubleValueTranscoder getDoublePrimitiveValueTranscoder() {
204 if (doublePrimitiveValueTranscoder == null) {
205 doublePrimitiveValueTranscoder = new DoubleValueTranscoder(true);
206 }
207 return doublePrimitiveValueTranscoder;
208 }
209
210
211
212
213
214
215 public static FileTimeValueTranscoder getFileTimeValueTranscoder() {
216 if (fileTimeValueTranscoder == null) {
217 fileTimeValueTranscoder = new FileTimeValueTranscoder();
218 }
219 return fileTimeValueTranscoder;
220 }
221
222
223
224
225
226
227 public static FileTimeToOffsetDateTimeValueTranscoder
228 getFileTimeToOffsetDateTimeValueTranscoder() {
229 if (fileTimeToOffsetDateTimeValueTranscoder == null) {
230 fileTimeToOffsetDateTimeValueTranscoder = new FileTimeToOffsetDateTimeValueTranscoder();
231 }
232 return fileTimeToOffsetDateTimeValueTranscoder;
233 }
234
235
236
237
238
239
240 public static FloatValueTranscoder getFloatValueTranscoder() {
241 if (floatValueTranscoder == null) {
242 floatValueTranscoder = new FloatValueTranscoder(false);
243 }
244 return floatValueTranscoder;
245 }
246
247
248
249
250
251
252 public static FloatValueTranscoder getFloatPrimitiveValueTranscoder() {
253 if (floatPrimitiveValueTranscoder == null) {
254 floatPrimitiveValueTranscoder = new FloatValueTranscoder(true);
255 }
256 return floatPrimitiveValueTranscoder;
257 }
258
259
260
261
262
263
264 public static GeneralizedTimeValueTranscoder getGeneralizedTimeValueTranscoder() {
265 if (generalizedTimeValueTranscoder == null) {
266 generalizedTimeValueTranscoder = new GeneralizedTimeValueTranscoder();
267 }
268 return generalizedTimeValueTranscoder;
269 }
270
271
272
273
274
275
276 public static GeneralizedTimeToOffsetDateTimeValueTranscoder
277 getGeneralizedTimeToOffsetDateTimeValueTranscoder() {
278 if (generalizedTimeToOffsetDateTimeValueTranscoder == null) {
279 generalizedTimeToOffsetDateTimeValueTranscoder
280 = new GeneralizedTimeToOffsetDateTimeValueTranscoder();
281 }
282 return generalizedTimeToOffsetDateTimeValueTranscoder;
283 }
284
285
286
287
288
289
290 public static IntegerValueTranscoder getIntegerValueTranscoder() {
291 if (integerValueTranscoder == null) {
292 integerValueTranscoder = new IntegerValueTranscoder(false);
293 }
294 return integerValueTranscoder;
295 }
296
297
298
299
300
301
302 public static IntegerValueTranscoder getIntegerPrimitiveValueTranscoder() {
303 if (integerPrimitiveValueTranscoder == null) {
304 integerPrimitiveValueTranscoder = new IntegerValueTranscoder(true);
305 }
306 return integerPrimitiveValueTranscoder;
307 }
308
309
310
311
312
313
314 public static LongValueTranscoder getLongValueTranscoder() {
315 if (longValueTranscoder == null) {
316 longValueTranscoder = new LongValueTranscoder(false);
317 }
318 return longValueTranscoder;
319 }
320
321
322
323
324
325
326 public static LongValueTranscoder getLongPrimitiveValueTranscoder() {
327 if (longValuePrimitiveTranscoder == null) {
328 longValuePrimitiveTranscoder = new LongValueTranscoder(true);
329 }
330 return longValuePrimitiveTranscoder;
331 }
332
333
334
335
336
337
338 public static ShortValueTranscoder getShortValueTranscoder() {
339 if (shortValueTranscoder == null) {
340 shortValueTranscoder = new ShortValueTranscoder(false);
341 }
342 return shortValueTranscoder;
343 }
344
345
346
347
348
349
350 public static ShortValueTranscoder getShortPrimitiveValueTranscoder() {
351 if (shortPrimitiveValueTranscoder == null) {
352 shortPrimitiveValueTranscoder = new ShortValueTranscoder(true);
353 }
354 return shortPrimitiveValueTranscoder;
355 }
356
357
358
359
360
361
362 public static StringValueTranscoder getStringValueTranscoder() {
363 if (stringValueTranscoder == null) {
364 stringValueTranscoder = new StringValueTranscoder();
365 }
366 return stringValueTranscoder;
367 }
368
369
370
371
372
373
374 public static UserAccountControlValueTranscoder getUserAccountControlValueTranscoder() {
375 if (userAccountControlValueTranscoder == null) {
376 userAccountControlValueTranscoder = new UserAccountControlValueTranscoder();
377 }
378 return userAccountControlValueTranscoder;
379 }
380
381
382
383
384
385
386 public static UUIDValueTranscoder getUuidValueTranscoder() {
387 if (uuidValueTranscoder == null) {
388 uuidValueTranscoder = new UUIDValueTranscoder();
389 }
390 return uuidValueTranscoder;
391 }
392
393
394
395
396
397
398 public static UnicodePwdValueTranscoder getUnicodePwdValueTranscoder() {
399 if (unicodePwdValueTranscoder == null) {
400 unicodePwdValueTranscoder = new UnicodePwdValueTranscoder();
401 }
402 return unicodePwdValueTranscoder;
403 }
404
405 }