Revision 2080 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/dataTypes/impl/DefaultDataTypesManager.java
DefaultDataTypesManager.java | ||
---|---|---|
27 | 27 |
import java.math.BigDecimal; |
28 | 28 |
import java.net.URI; |
29 | 29 |
import java.net.URL; |
30 |
import java.sql.Timestamp; |
|
31 | 30 |
import java.util.ArrayList; |
32 | 31 |
import java.util.Date; |
33 | 32 |
import java.util.Iterator; |
... | ... | |
36 | 35 |
import java.util.Set; |
37 | 36 |
|
38 | 37 |
import org.gvsig.installer.lib.api.Version; |
38 |
import org.gvsig.tools.dataTypes.Coercion; |
|
39 | 39 |
import org.gvsig.tools.dataTypes.CoercionException; |
40 | 40 |
import org.gvsig.tools.dataTypes.DataType; |
41 | 41 |
import org.gvsig.tools.dataTypes.DataTypes; |
42 | 42 |
import org.gvsig.tools.dataTypes.DataTypesManager; |
43 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToBigDecimal;
|
|
43 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToDecimal; |
|
44 | 44 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToBoolean; |
45 | 45 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToByte; |
46 | 46 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToBytearray; |
47 | 47 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate; |
48 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToDateTime; |
|
48 | 49 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToDouble; |
49 | 50 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToFile; |
50 | 51 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToFloat; |
... | ... | |
53 | 54 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToObject; |
54 | 55 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToString; |
55 | 56 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToTime; |
56 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToTimestamp; |
|
57 | 57 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToURI; |
58 | 58 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToURL; |
59 | 59 |
import org.gvsig.tools.dataTypes.impl.coercion.CoerceToVersion; |
... | ... | |
80 | 80 |
this.addtype(LONG, null, "Long", Long.class, new CoerceToLong(),"datatype-long"); |
81 | 81 |
this.addtype(FLOAT, null, "Float", Float.class, new CoerceToFloat(),"datatype-float"); |
82 | 82 |
this.addtype(DOUBLE, null, "Double", Double.class, new CoerceToDouble(),"datatype-double"); |
83 |
this.addtype(BIGDECIMAL, null, "BigDecimal", BigDecimal.class, new CoerceToBigDecimal());
|
|
83 |
this.addtype(DECIMAL, null, "Decimal", BigDecimal.class, new CoerceToDecimal());
|
|
84 | 84 |
this.addtype(STRING, null, "String", String.class, new CoerceToString(), "datatype-string"); |
85 | 85 |
this.addtype(DATE, SUBTYPE_DATE, "Date", Date.class, new CoerceToDate(),"datatype-date"); |
86 | 86 |
this.addtype(TIME, SUBTYPE_DATE, "Time", Date.class, new CoerceToTime(),"datatype-time"); |
87 |
this.addtype(TIMESTAMP, null, "Timestamp", Timestamp.class, new CoerceToTimestamp(),"datatype-timestamp"); |
|
87 |
// this.addtype(TIMESTAMP, null, "Timestamp", Timestamp.class, new CoerceToTimestamp(),"datatype-timestamp"); |
|
88 |
this.addtype(TIMESTAMP, null, "Timestamp", Date.class, new CoerceToDateTime(),"datatype-timestamp"); |
|
88 | 89 |
this.addtype(VERSION, null, "Version", Version.class, new CoerceToVersion()); |
89 | 90 |
|
90 | 91 |
this.addtype(BYTEARRAY, null, "ByteArray", |
... | ... | |
93 | 94 |
"datatype-bytearray" |
94 | 95 |
); |
95 | 96 |
this.addtype(FILE, SUBTYPE_FILE, "File", File.class, new CoerceToFile()); |
96 |
this.addtype(FOLDER, SUBTYPE_FOLDER, "Folder", File.class, |
|
97 |
new CoerceToFile()); |
|
97 |
this.addtype(FOLDER, SUBTYPE_FOLDER, "Folder", File.class, new CoerceToFile()); |
|
98 | 98 |
this.addtype(DYNOBJECT, null, "DynObject", DynObject.class, null); |
99 | 99 |
this.addtype(URL, null, "URL", URL.class, new CoerceToURL()); |
100 | 100 |
this.addtype(URI, null, "URI", URI.class, new CoerceToURI()); |
... | ... | |
220 | 220 |
return dataType.getCoercion(); |
221 | 221 |
} |
222 | 222 |
|
223 |
@Override |
|
224 |
public void setCoercion(int type, Coercion coercion) { |
|
225 |
DataType dataType = get(type); |
|
226 |
dataType.setCoercion(coercion); |
|
227 |
} |
|
223 |
// @Override
|
|
224 |
// public void setCoercion(int type, Coercion coercion) {
|
|
225 |
// DataType dataType = get(type);
|
|
226 |
// dataType.setCoercion(coercion);
|
|
227 |
// }
|
|
228 | 228 |
|
229 | 229 |
@Override |
230 | 230 |
public void addCoercion(int type, Coercion coercion) { |
Also available in: Unified diff