77 lines
2.0 KiB
Java
77 lines
2.0 KiB
Java
package org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column;
|
|
|
|
|
|
/**
|
|
*
|
|
* @author "Giancarlo Panichi"
|
|
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class ColumnTypeMap {
|
|
|
|
|
|
public static ColumnDataType getColumnDataType(String id){
|
|
if(id.compareTo(ColumnDataType.Integer.toString())==0){
|
|
return ColumnDataType.Integer;
|
|
} else {
|
|
if(id.compareTo(ColumnDataType.Geometry.toString())==0){
|
|
return ColumnDataType.Geometry;
|
|
} else {
|
|
if(id.compareTo(ColumnDataType.Boolean.toString())==0){
|
|
return ColumnDataType.Boolean;
|
|
} else {
|
|
if(id.compareTo(ColumnDataType.Numeric.toString())==0){
|
|
return ColumnDataType.Numeric;
|
|
} else {
|
|
if(id.compareTo(ColumnDataType.Date.toString())==0){
|
|
return ColumnDataType.Date;
|
|
} else {
|
|
if(id.compareTo(ColumnDataType.Text.toString())==0){
|
|
return ColumnDataType.Text;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static ColumnTypeCode getColumnTypeCode(String id){
|
|
if(id.compareTo(ColumnTypeCode.ANNOTATION.toString())==0){
|
|
return ColumnTypeCode.ANNOTATION;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.ATTRIBUTE.toString())==0){
|
|
return ColumnTypeCode.ATTRIBUTE;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.MEASURE.toString())==0){
|
|
return ColumnTypeCode.MEASURE;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.CODE.toString())==0){
|
|
return ColumnTypeCode.CODE;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.CODENAME.toString())==0){
|
|
return ColumnTypeCode.CODENAME;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.CODEDESCRIPTION.toString())==0){
|
|
return ColumnTypeCode.CODEDESCRIPTION;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.DIMENSION.toString())==0){
|
|
return ColumnTypeCode.DIMENSION;
|
|
} else {
|
|
if(id.compareTo(ColumnTypeCode.TIMEDIMENSION.toString())==0){
|
|
return ColumnTypeCode.TIMEDIMENSION;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|