1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.type;
17
18 import java.math.BigDecimal;
19 import java.math.BigInteger;
20 import java.util.Date;
21 import java.util.HashSet;
22 import java.util.Set;
23
24
25
26
27 public class SimpleTypeRegistry {
28
29 private static final Set<Class<?>> SIMPLE_TYPE_SET = new HashSet<>();
30
31 static {
32 SIMPLE_TYPE_SET.add(String.class);
33 SIMPLE_TYPE_SET.add(Byte.class);
34 SIMPLE_TYPE_SET.add(Short.class);
35 SIMPLE_TYPE_SET.add(Character.class);
36 SIMPLE_TYPE_SET.add(Integer.class);
37 SIMPLE_TYPE_SET.add(Long.class);
38 SIMPLE_TYPE_SET.add(Float.class);
39 SIMPLE_TYPE_SET.add(Double.class);
40 SIMPLE_TYPE_SET.add(Boolean.class);
41 SIMPLE_TYPE_SET.add(Date.class);
42 SIMPLE_TYPE_SET.add(Class.class);
43 SIMPLE_TYPE_SET.add(BigInteger.class);
44 SIMPLE_TYPE_SET.add(BigDecimal.class);
45 }
46
47 private SimpleTypeRegistry() {
48
49 }
50
51
52
53
54
55
56
57 public static boolean isSimpleType(Class<?> clazz) {
58 return SIMPLE_TYPE_SET.contains(clazz);
59 }
60
61 }