98 |
98 |
|
99 |
99 |
public DefaultDataTypesManager() {
|
100 |
100 |
|
101 |
|
this.addtype(BOOLEAN, null, "Boolean", Boolean.class, new CoerceToBoolean(),
|
|
101 |
this.addtype(BOOLEAN, null, DataTypes.BOOLEAN_NAME, Boolean.class, new CoerceToBoolean(),
|
102 |
102 |
"datatype-boolean"
|
103 |
103 |
);
|
104 |
|
this.addtype(BYTE, null, "Byte", Byte.class, new CoerceToByte(),
|
|
104 |
this.addtype(BYTE, null, DataTypes.BYTE_NAME, Byte.class, new CoerceToByte(),
|
105 |
105 |
"datatype-byte",
|
106 |
106 |
FLAG_NUMBER|FLAG_SUPPORT_PRECISION|FLAG_PREDEFINED_PRECISION,
|
107 |
107 |
BYTE_MAX_PRECISION, BYTE_DEFAULT_PRECISION
|
108 |
108 |
);
|
109 |
|
this.addtype(CHAR, null, "Char", Character.class, new CoerceToString());
|
|
109 |
this.addtype(CHAR, null, DataTypes.CHAR_NAME, Character.class, new CoerceToString());
|
110 |
110 |
this.addtype(INT, null, "Integer", Integer.class, new CoerceToInt(),
|
111 |
111 |
"datatype-integer",
|
112 |
112 |
FLAG_NUMBER|FLAG_SUPPORT_PRECISION|FLAG_PREDEFINED_PRECISION,
|
113 |
113 |
INT_MAX_PRECISION, INT_DEFAULT_PRECISION
|
114 |
114 |
);
|
115 |
|
this.addtype(LONG, null, "Long", Long.class, new CoerceToLong(),
|
|
115 |
this.addtype(LONG, null, DataTypes.LONG_NAME, Long.class, new CoerceToLong(),
|
116 |
116 |
"datatype-long",
|
117 |
117 |
FLAG_NUMBER|FLAG_SUPPORT_PRECISION|FLAG_PREDEFINED_PRECISION,
|
118 |
118 |
LONG_MAX_PRECISION, LONG_DEFAULT_PRECISION
|
119 |
119 |
);
|
120 |
|
this.addtype(FLOAT, null, "Float", Float.class, new CoerceToFloat(),
|
|
120 |
this.addtype(FLOAT, null, DataTypes.FLOAT_NAME, Float.class, new CoerceToFloat(),
|
121 |
121 |
"datatype-float",
|
122 |
122 |
FLAG_FLOATING_POINT|FLAG_SUPPORT_PRECISION|FLAG_PREDEFINED_PRECISION|FLAG_SUPPORT_SCALE,
|
123 |
123 |
FLOAT_MAX_PRECISION, FLOAT_DEFAULT_PRECISION, FLOAT_DEFAULT_SCALE
|
124 |
124 |
);
|
125 |
|
this.addtype(DOUBLE, null, "Double", Double.class, new CoerceToDouble(),
|
|
125 |
this.addtype(DOUBLE, null, DataTypes.DOUBLE_NAME, Double.class, new CoerceToDouble(),
|
126 |
126 |
"datatype-double",
|
127 |
127 |
FLAG_FLOATING_POINT|FLAG_SUPPORT_PRECISION|FLAG_PREDEFINED_PRECISION|FLAG_SUPPORT_SCALE,
|
128 |
128 |
DOUBLE_MAX_PRECISION, DOUBLE_DEFAULT_PRECISION, DOUBLE_DEFAULT_SCALE
|
129 |
129 |
);
|
130 |
|
this.addtype(DECIMAL, null, "Decimal", BigDecimal.class, new CoerceToDecimal(),
|
|
130 |
this.addtype(DECIMAL, null, DataTypes.DECIMAL_NAME, BigDecimal.class, new CoerceToDecimal(),
|
131 |
131 |
"datatype-decimal",
|
132 |
132 |
FLAG_NUMBER|FLAG_SUPPORT_PRECISION|FLAG_SUPPORT_SCALE,
|
133 |
133 |
DECIMAL_MAX_PRECISION, DECIMAL_DEFAULT_PRECISION, DECIMAL_DEFAULT_SCALE
|
134 |
134 |
);
|
135 |
|
this.addtype(STRING, null, "String", String.class, new CoerceToString(),
|
|
135 |
this.addtype(STRING, null, DataTypes.STRING_NAME, String.class, new CoerceToString(),
|
136 |
136 |
"datatype-string",
|
137 |
137 |
FLAG_SUPPORT_SIZE
|
138 |
138 |
).setDefaultSize(STRING_DEFAULT_SIZE);
|
139 |
|
this.addtype(DATE, SUBTYPE_DATE, "Date", Date.class, new CoerceToDate(), "datatype-date");
|
140 |
|
this.addtype(TIME, SUBTYPE_DATE, "Time", Date.class, new CoerceToTime(), "datatype-time");
|
141 |
|
this.addtype(TIMESTAMP, SUBTYPE_DATE, "Timestamp", Date.class, new CoerceToTimestamp(), "datatype-timestamp");
|
|
139 |
this.addtype(DATE, SUBTYPE_DATE, DataTypes.DATE_NAME, Date.class, new CoerceToDate(), "datatype-date");
|
|
140 |
this.addtype(TIME, SUBTYPE_DATE, DataTypes.TIME_NAME, Date.class, new CoerceToTime(), "datatype-time");
|
|
141 |
this.addtype(TIMESTAMP, SUBTYPE_DATE, DataTypes.TIMESTAMP_NAME, Date.class, new CoerceToTimestamp(), "datatype-timestamp");
|
142 |
142 |
|
143 |
|
this.addtype(LOCALE, null, "Locale", Locale.class, new CoerceToLocale(),
|
|
143 |
this.addtype(LOCALE, null, DataTypes.LOCALE_NAME, Locale.class, new CoerceToLocale(),
|
144 |
144 |
"datatype-locale"
|
145 |
145 |
);
|
146 |
146 |
|
147 |
147 |
|
148 |
|
this.addtype(VERSION, null, "Version", Version.class, new CoerceToVersion());
|
|
148 |
this.addtype(VERSION, null, DataTypes.VERSION_NAME, Version.class, new CoerceToVersion());
|
149 |
149 |
|
150 |
|
this.addtype(BYTEARRAY, null, "ByteArray",
|
|
150 |
this.addtype(BYTEARRAY, null, DataTypes.BYTEARRAY_NAME,
|
151 |
151 |
(new byte[1]).getClass(),
|
152 |
152 |
new CoerceToBytearray(),
|
153 |
153 |
"datatype-bytearray",
|
154 |
154 |
FLAG_SUPPORT_SIZE
|
155 |
155 |
);
|
156 |
|
this.addtype(FILE, SUBTYPE_FILE, "File", File.class, new CoerceToFile());
|
157 |
|
this.addtype(FOLDER, SUBTYPE_FOLDER, "Folder", File.class, new CoerceToFile());
|
158 |
|
this.addtype(DYNOBJECT, null, "DynObject", DynObject.class, null);
|
159 |
|
this.addtype(URL, null, "URL", URL.class, new CoerceToURL());
|
160 |
|
this.addtype(URI, null, "URI", URI.class, new CoerceToURI());
|
|
156 |
this.addtype(FILE, SUBTYPE_FILE, DataTypes.FILE_NAME, File.class, new CoerceToFile());
|
|
157 |
this.addtype(FOLDER, SUBTYPE_FOLDER, DataTypes.FOLDER_NAME, File.class, new CoerceToFile());
|
|
158 |
this.addtype(DYNOBJECT, null, DataTypes.DYNOBJECT_NAME, DynObject.class, null);
|
|
159 |
this.addtype(URL, null, DataTypes.URL_NAME, URL.class, new CoerceToURL());
|
|
160 |
this.addtype(URI, null, DataTypes.URI_NAME, URI.class, new CoerceToURI());
|
161 |
161 |
|
162 |
|
this.addtype(ARRAY, null, "Array", (new Object[1]).getClass(), null);
|
163 |
|
this.addtype(LIST, null, "List", List.class, null);
|
164 |
|
this.addtype(SET, null, "Set", Set.class, null);
|
165 |
|
this.addtype(MAP, null, "Map", Map.class, null);
|
|
162 |
this.addtype(ARRAY, null, DataTypes.ARRAY_NAME, (new Object[1]).getClass(), null);
|
|
163 |
this.addtype(LIST, null, DataTypes.LIST_NAME, List.class, null);
|
|
164 |
this.addtype(SET, null, DataTypes.SET_NAME, Set.class, null);
|
|
165 |
this.addtype(MAP, null, DataTypes.MAP_NAME, Map.class, null);
|
166 |
166 |
|
167 |
|
this.addtype(OBJECT, null, "Object", Object.class, new CoerceToObject(), "datatype-object");
|
|
167 |
this.addtype(OBJECT, null, DataTypes.OBJECT_NAME, Object.class, new CoerceToObject(), "datatype-object");
|
168 |
168 |
}
|
169 |
169 |
|
170 |
170 |
@Override
|