/** * Find or create a TypePair for the specified data type. The current implementation * looks for exact matches in the dataTypes map and, if not found, it rechecks with * just the base datatype when the specified TapDataType has length is greater than * 1; the latter takes care of arrays of strings (char(n) or char(*)) and should work * for other arrays. * * @param tt * @return */ protected TypePair findTypePair(TapDataType tt) { TypePair dbt = dataTypes.get(tt); if (dbt == null && tt.arraysize != null) { // input may have a non-matching arraysize TapDataType tmp = new TapDataType(tt.getDatatype(), "*", tt.xtype); dbt = dataTypes.get(tmp); } if (dbt == null) { throw new UnsupportedOperationException("unexpected datatype: " + tt); } log.debug("findTypePair: " + tt + " -> " + dbt); return dbt; }
protected VOTableField createVOTableField(TapSelectItem resultCol) { if (resultCol != null) { TapDataType tt = resultCol.getDatatype(); VOTableField newField = new VOTableField(resultCol.getName(),tt.getDatatype(), tt.arraysize); newField.xtype = tt.xtype; newField.description = resultCol.description; newField.id = resultCol.id; newField.utype = resultCol.utype; newField.ucd = resultCol.ucd; newField.unit = resultCol.unit; return newField; } return null; } }
safeSetString(sb, ps, col++, column.ucd); safeSetString(sb, ps, col++, column.unit); safeSetString(sb, ps, col++, column.getDatatype().getDatatype()); safeSetString(sb, ps, col++, column.getDatatype().arraysize); safeSetString(sb, ps, col++, column.getDatatype().xtype);
/** * Create a VOTableField from a ColumnDesc. * * @param column * @return The associated VOTableField */ public static VOTableField convert(ColumnDesc column) { VOTableField vtf = new VOTableField( column.getColumnName(), column.getDatatype().getDatatype(), column.getDatatype().arraysize); vtf.xtype = column.getDatatype().xtype; return vtf; }
String datatype = tt.getDatatype();
String[] parts = tt.getDatatype().split(":"); Element eleDt = addChild(eleColumn, "dataType", tt.getDatatype()); if (eleDt != null)