Skip to content
Snippets Groups Projects
Commit d399afd1 authored by gmantele's avatar gmantele
Browse files

[TAP] Ensure scalar values do not have an `arraysize="1"` attribute in VOTable.

parent 9c0b2a7b
Branches
No related tags found
No related merge requests found
package tap.metadata; package tap.metadata;
import adql.db.DBType;
import adql.db.DBType.DBDatatype;
/* /*
* This file is part of TAPLibrary. * This file is part of TAPLibrary.
* *
...@@ -16,14 +19,12 @@ package tap.metadata; ...@@ -16,14 +19,12 @@ package tap.metadata;
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>. * along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Copyright 2012-2017 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Astronomisches Rechen Institut (ARI) * Astronomisches Rechen Institut (ARI)
*/ */
import tap.TAPException; import tap.TAPException;
import uk.ac.starlink.votable.VOSerializer; import uk.ac.starlink.votable.VOSerializer;
import adql.db.DBType;
import adql.db.DBType.DBDatatype;
/** /**
* <p>Describes a full VOTable type. Thus it includes the following field attributes:</p> * <p>Describes a full VOTable type. Thus it includes the following field attributes:</p>
...@@ -34,7 +35,7 @@ import adql.db.DBType.DBDatatype; ...@@ -34,7 +35,7 @@ import adql.db.DBType.DBDatatype;
* </ul> * </ul>
* *
* @author Gr&eacute;gory Mantelet (CDS;ARI) * @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 2.0 (02/2015) * @version 2.1 (03/2017)
*/ */
public final class VotType { public final class VotType {
/** /**
...@@ -129,43 +130,43 @@ public final class VotType { ...@@ -129,43 +130,43 @@ public final class VotType {
switch(tapType.type){ switch(tapType.type){
case SMALLINT: case SMALLINT:
this.datatype = VotDatatype.SHORT; this.datatype = VotDatatype.SHORT;
this.arraysize = "1"; this.arraysize = null;
this.xtype = null; this.xtype = null;
break; break;
case INTEGER: case INTEGER:
this.datatype = VotDatatype.INT; this.datatype = VotDatatype.INT;
this.arraysize = "1"; this.arraysize = null;
this.xtype = null; this.xtype = null;
break; break;
case BIGINT: case BIGINT:
this.datatype = VotDatatype.LONG; this.datatype = VotDatatype.LONG;
this.arraysize = "1"; this.arraysize = null;
this.xtype = null; this.xtype = null;
break; break;
case REAL: case REAL:
this.datatype = VotDatatype.FLOAT; this.datatype = VotDatatype.FLOAT;
this.arraysize = "1"; this.arraysize = null;
this.xtype = null; this.xtype = null;
break; break;
case DOUBLE: case DOUBLE:
this.datatype = VotDatatype.DOUBLE; this.datatype = VotDatatype.DOUBLE;
this.arraysize = "1"; this.arraysize = null;
this.xtype = null; this.xtype = null;
break; break;
case CHAR: case CHAR:
this.datatype = VotDatatype.CHAR; this.datatype = VotDatatype.CHAR;
this.arraysize = Integer.toString(tapType.length > 0 ? tapType.length : 1); this.arraysize = Integer.toString(tapType.length > 0 ? tapType.length : null);
this.xtype = null; this.xtype = null;
break; break;
case BINARY: case BINARY:
this.datatype = VotDatatype.UNSIGNEDBYTE; this.datatype = VotDatatype.UNSIGNEDBYTE;
this.arraysize = Integer.toString(tapType.length > 0 ? tapType.length : 1); this.arraysize = Integer.toString(tapType.length > 0 ? tapType.length : null);
this.xtype = null; this.xtype = null;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment