|
64 | 64 | */
|
65 | 65 | public final class ModelerUtil {
|
66 | 66 |
|
| 67 | + static final String[] REGISTERED_TYPE_NAMES; |
| 68 | + static { |
| 69 | + String[] nonPrimitivesNames = { |
| 70 | + String.class.getName(), |
| 71 | + BigDecimal.class.getName(), |
| 72 | + BigInteger.class.getName(), |
| 73 | + Boolean.class.getName(), |
| 74 | + Byte.class.getName(), |
| 75 | + Character.class.getName(), |
| 76 | + Date.class.getName(), |
| 77 | + java.util.Date.class.getName(), |
| 78 | + Double.class.getName(), |
| 79 | + Float.class.getName(), |
| 80 | + Integer.class.getName(), |
| 81 | + Long.class.getName(), |
| 82 | + Short.class.getName(), |
| 83 | + Time.class.getName(), |
| 84 | + Timestamp.class.getName(), |
| 85 | + GregorianCalendar.class.getName(), |
| 86 | + Calendar.class.getName(), |
| 87 | + UUID.class.getName(), |
| 88 | + Serializable.class.getName(), |
| 89 | + Json.class.getName(), |
| 90 | + Wkt.class.getName(), |
| 91 | + GeoJson.class.getName(), |
| 92 | + "java.lang.Character[]", |
| 93 | + "java.lang.Byte[]", |
| 94 | + "java.time.LocalDate", |
| 95 | + "java.time.LocalTime", |
| 96 | + "java.time.LocalDateTime", |
| 97 | + "java.time.Duration", |
| 98 | + "java.time.Period" |
| 99 | + }; |
| 100 | + Arrays.sort(nonPrimitivesNames); |
| 101 | + |
| 102 | + String[] primitivesNames = { |
| 103 | + "boolean", "byte", "byte[]", "char", "char[]", "double", "float", "int", "long", "short" |
| 104 | + }; |
| 105 | + |
| 106 | + REGISTERED_TYPE_NAMES = new String[primitivesNames.length + nonPrimitivesNames.length + 1]; |
| 107 | + |
| 108 | + REGISTERED_TYPE_NAMES[0] = ""; |
| 109 | + System.arraycopy(primitivesNames, 0, REGISTERED_TYPE_NAMES, 1, primitivesNames.length); |
| 110 | + System.arraycopy( |
| 111 | + nonPrimitivesNames, |
| 112 | + 0, |
| 113 | + REGISTERED_TYPE_NAMES, |
| 114 | + primitivesNames.length + 1, |
| 115 | + nonPrimitivesNames.length); |
| 116 | + } |
| 117 | + |
67 | 118 | /**
|
68 | 119 | * Returns the "name" property of the object.
|
69 | 120 | *
|
@@ -110,55 +161,7 @@ public static Collection<String> getDbAttributeNames(DbEntity entity) {
|
110 | 161 | }
|
111 | 162 |
|
112 | 163 | public static String[] getRegisteredTypeNames() {
|
113 |
| - String[] nonPrimitivesNames = { |
114 |
| - String.class.getName(), |
115 |
| - BigDecimal.class.getName(), |
116 |
| - BigInteger.class.getName(), |
117 |
| - Boolean.class.getName(), |
118 |
| - Byte.class.getName(), |
119 |
| - Character.class.getName(), |
120 |
| - Date.class.getName(), |
121 |
| - java.util.Date.class.getName(), |
122 |
| - Double.class.getName(), |
123 |
| - Float.class.getName(), |
124 |
| - Integer.class.getName(), |
125 |
| - Long.class.getName(), |
126 |
| - Short.class.getName(), |
127 |
| - Time.class.getName(), |
128 |
| - Timestamp.class.getName(), |
129 |
| - GregorianCalendar.class.getName(), |
130 |
| - Calendar.class.getName(), |
131 |
| - UUID.class.getName(), |
132 |
| - Serializable.class.getName(), |
133 |
| - Json.class.getName(), |
134 |
| - Wkt.class.getName(), |
135 |
| - GeoJson.class.getName(), |
136 |
| - "java.lang.Character[]", |
137 |
| - "java.lang.Byte[]", |
138 |
| - "java.time.LocalDate", |
139 |
| - "java.time.LocalTime", |
140 |
| - "java.time.LocalDateTime", |
141 |
| - "java.time.Duration", |
142 |
| - "java.time.Period" |
143 |
| - }; |
144 |
| - Arrays.sort(nonPrimitivesNames); |
145 |
| - |
146 |
| - String[] primitivesNames = { |
147 |
| - "boolean", "byte", "byte[]", "char", "char[]", "double", "float", "int", "long", "short" |
148 |
| - }; |
149 |
| - |
150 |
| - String[] finalList = new String[primitivesNames.length + nonPrimitivesNames.length + 1]; |
151 |
| - |
152 |
| - finalList[0] = ""; |
153 |
| - System.arraycopy(primitivesNames, 0, finalList, 1, primitivesNames.length); |
154 |
| - System.arraycopy( |
155 |
| - nonPrimitivesNames, |
156 |
| - 0, |
157 |
| - finalList, |
158 |
| - primitivesNames.length + 1, |
159 |
| - nonPrimitivesNames.length); |
160 |
| - |
161 |
| - return finalList; |
| 164 | + return REGISTERED_TYPE_NAMES; |
162 | 165 | }
|
163 | 166 |
|
164 | 167 | public static DataNodeDescriptor getNodeLinkedToMap(DataChannelDescriptor domain, DataMap map) {
|
|
0 commit comments