tabular-data-widget-common-.../src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnMockUp.java

414 lines
9.7 KiB
Java

package org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column;
import java.io.Serializable;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
/**
*
* @author Giancarlo Panichi
*
*/
public class ColumnMockUp implements Serializable {
private static final long serialVersionUID = 7467523779864189492L;
private String id;// For grid and combo only;
private String columnId;// ColumnId for template only;
private ColumnTypeCode columnType;
private ColumnDataType columnDataType;
private String defaultValue;
private String label;
private String localeName;
private boolean hasExpression;
private C_Expression expression;
protected PeriodDataType timeDimensionType;
protected ColumnData codelistColumnReference;
public ColumnMockUp() {
}
/**
* Generic simple column with only ColumnDataType set
*
* @param id
* Id
* @param columnId
* Column id
* @param columnDataType
* Column data type
* @param label
* Label
*/
public ColumnMockUp(String id, String columnId, ColumnDataType columnDataType, String label) {
super();
this.id = id;
this.columnId = columnId;
this.columnType = null;
this.columnDataType = columnDataType;
this.defaultValue = null;
this.label = label;
this.localeName = null;
this.hasExpression = false;
this.expression = null;
this.timeDimensionType = null;
this.codelistColumnReference = null;
}
/**
* ColumnMockUp
*
*
* @param id
* Id
* @param columnId
* Column id
* @param columnType
* Column type
* @param columnDataType
* Column data type
* @param label
* Label
*/
public ColumnMockUp(String id, String columnId, ColumnTypeCode columnType, ColumnDataType columnDataType,
String label) {
super();
this.id = id;
this.columnId = columnId;
this.columnType = columnType;
this.columnDataType = columnDataType;
this.defaultValue = null;
this.label = label;
this.localeName = null;
this.hasExpression = false;
this.expression = null;
this.timeDimensionType = null;
this.codelistColumnReference = null;
}
/**
* For Code, CodeDescription and Annotation Column
*
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column data type
* @param defaultValue
* Default value
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType, String defaultValue) {
this.id = id;
this.columnId = columnId;
this.label = label;
this.columnType = columnType;
this.columnDataType = ColumnDataType.Text;
this.defaultValue = defaultValue;
hasExpression = false;
expression = null;
}
/**
* For Code, CodeDescription and Annotation Column
*
* @param id
* Id
* @param columnId
* Column Id
* @param label
* Label
* @param columnType
* Column Type
* @param expression
* Expression
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType, C_Expression expression) {
this.id = null;
this.columnId = null;
this.label = label;
this.columnType = columnType;
this.columnDataType = ColumnDataType.Text;
this.defaultValue = null;
hasExpression = true;
this.expression = expression;
}
/**
* For Attribute and Measure Column
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column type
* @param columnDataType
* Column data type
* @param defaultValue
* Default value
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType,
ColumnDataType columnDataType, String defaultValue) {
this.id = id;
this.columnId = columnId;
this.label = label;
this.columnType = columnType;
this.columnDataType = columnDataType;
this.defaultValue = defaultValue;
hasExpression = false;
expression = null;
}
/**
* For Attribute and Measure Column
*
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column type
* @param columnDataType
* Column data type
* @param expression
* Expression
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType,
ColumnDataType columnDataType, C_Expression expression) {
this.id = id;
this.columnId = columnId;
this.label = label;
this.columnType = columnType;
this.columnDataType = columnDataType;
this.defaultValue = null;
hasExpression = true;
this.expression = expression;
}
/**
* For CodeName Column
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column type
* @param localeName
* Locale name
* @param defaultValue
* Default value
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType, String localeName,
String defaultValue) {
this.id = null;
this.columnId = null;
this.label = label;
this.columnType = columnType;
this.columnDataType = ColumnDataType.Text;
this.localeName = localeName;
this.defaultValue = defaultValue;
hasExpression = false;
expression = null;
}
/**
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column type
* @param localeName
* Locale name
* @param expression
* Expression
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType, String localeName,
C_Expression expression) {
this.id = id;
this.columnId = columnId;
this.label = label;
this.columnType = columnType;
this.columnDataType = ColumnDataType.Text;
this.localeName = localeName;
this.defaultValue = null;
hasExpression = true;
this.expression = expression;
}
/**
* For Dimension
*
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column type
* @param codelistColumnReference
* Coldelist column reference
* @param defaultValue
* Default value
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType,
ColumnData codelistColumnReference, String defaultValue) {
this.id = id;
this.columnId = columnId;
this.label = label;
this.columnType = columnType;
this.columnDataType = ColumnDataType.Integer;
this.codelistColumnReference = codelistColumnReference;
this.defaultValue = defaultValue;
hasExpression = false;
expression = null;
}
/**
* For TimeDimension
*
* @param id
* Id
* @param columnId
* Column id
* @param label
* Label
* @param columnType
* Column type
* @param timeDimensionType
* Time dimension type
* @param defaultValue
* Default value
*/
public ColumnMockUp(String id, String columnId, String label, ColumnTypeCode columnType,
PeriodDataType timeDimensionType, String defaultValue) {
this.id = id;
this.columnId = columnId;
this.label = label;
this.columnType = columnType;
this.columnDataType = ColumnDataType.Integer;
this.timeDimensionType = timeDimensionType;
this.defaultValue = defaultValue;
hasExpression = false;
expression = null;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public ColumnTypeCode getColumnType() {
return columnType;
}
public void setColumnType(ColumnTypeCode columnType) {
this.columnType = columnType;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getLocaleName() {
return localeName;
}
public void setLocaleName(String localeName) {
this.localeName = localeName;
}
public ColumnDataType getColumnDataType() {
return columnDataType;
}
public void setColumnDataType(ColumnDataType columnDataType) {
this.columnDataType = columnDataType;
}
public PeriodDataType getTimeDimensionType() {
return timeDimensionType;
}
public void setTimeDimensionType(PeriodDataType timeDimensionType) {
this.timeDimensionType = timeDimensionType;
}
public ColumnData getCodelistColumnReference() {
return codelistColumnReference;
}
public void setCodelistColumnReference(ColumnData codelistColumnReference) {
this.codelistColumnReference = codelistColumnReference;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public boolean hasExpression() {
return hasExpression;
}
public void setHasExpression(boolean hasExpression) {
this.hasExpression = hasExpression;
}
public C_Expression getExpression() {
return expression;
}
public void setExpression(C_Expression expression) {
this.expression = expression;
}
public String getColumnId() {
return columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
@Override
public String toString() {
return "ColumnMockUp [id=" + id + ", columnId=" + columnId + ", columnType=" + columnType + ", columnDataType="
+ columnDataType + ", defaultValue=" + defaultValue + ", label=" + label + ", localeName=" + localeName
+ ", hasExpression=" + hasExpression + ", expression=" + expression + ", timeDimensionType="
+ timeDimensionType + ", codelistColumnReference=" + codelistColumnReference + "]";
}
}