Revision 39583 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/core/fmap/DefinitionUtils.java
DefinitionUtils.java | ||
---|---|---|
110 | 110 |
solution.setName(layer.getName()); |
111 | 111 |
solution.setShapeType(layer.getShapeType()); |
112 | 112 |
SelectableDataSource datasource = layer.getRecordset(); |
113 |
int numFields = datasource.getFieldCount(); |
|
114 |
FieldDescription[] fields = |
|
115 |
new FieldDescription[numFields]; |
|
116 |
FieldDescription fieldDesc = null; |
|
117 |
for(int i = 0; i < numFields; i++){ |
|
118 |
fieldDesc = new FieldDescription(); |
|
119 |
fieldDesc.setFieldName(datasource.getFieldName(i)); |
|
120 |
int fieldType = datasource.getFieldType(i); |
|
121 |
fieldDesc.setFieldType(fieldType); |
|
122 |
int fieldLength = getDataTypeLength(fieldType); |
|
123 |
fieldDesc.setFieldLength(fieldLength); |
|
124 |
fieldDesc.setFieldDecimalCount(NUM_DECIMALS); |
|
125 |
fields[i] = fieldDesc; |
|
126 |
} |
|
127 |
solution.setFieldsDesc(fields); |
|
113 |
FieldDescription[] fieldsDescription = datasource.getFieldsDescription(); |
|
114 |
solution.setFieldsDesc(fieldsDescription); |
|
128 | 115 |
return solution; |
129 | 116 |
} |
130 | 117 |
|
Also available in: Unified diff