2015-03-26 16:06:53 +01:00
|
|
|
package org.gcube.portlets.user.td.widgetcommonevent.client.expression;
|
2015-03-26 14:41:33 +01:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
2015-04-13 12:58:02 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2017-05-16 16:35:52 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2015-03-26 14:41:33 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class ExpressionWrapper implements Serializable {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 3877772253100442685L;
|
2015-03-26 16:06:53 +01:00
|
|
|
private ExpressionWrapperType expressionType;
|
2015-03-26 14:41:33 +01:00
|
|
|
private TRId trId;
|
2015-04-13 12:58:02 +02:00
|
|
|
private ColumnData columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
private C_ExpressionContainer conditionExpressionContainer;
|
|
|
|
private boolean replaceByValue;
|
|
|
|
private String replaceValue;
|
|
|
|
private C_ExpressionContainer replaceExpressionContainer;
|
2017-05-16 16:35:52 +02:00
|
|
|
|
2015-03-26 14:41:33 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public ExpressionWrapper() {
|
|
|
|
super();
|
2017-05-16 16:35:52 +02:00
|
|
|
this.expressionType = ExpressionWrapperType.EXPRESSION_NULL;
|
2015-03-26 14:41:33 +01:00
|
|
|
}
|
2017-05-16 16:35:52 +02:00
|
|
|
|
2015-03-26 14:41:33 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param trId
|
2017-05-16 16:35:52 +02:00
|
|
|
* TR Id
|
|
|
|
* @param columnData
|
|
|
|
* Column data
|
2015-03-26 14:41:33 +01:00
|
|
|
* @param conditionExpressionContainer
|
2017-05-16 16:35:52 +02:00
|
|
|
* Condition expression container
|
2015-03-26 14:41:33 +01:00
|
|
|
*/
|
2017-05-16 16:35:52 +02:00
|
|
|
public ExpressionWrapper(TRId trId, ColumnData columnData, C_ExpressionContainer conditionExpressionContainer) {
|
2015-03-26 14:41:33 +01:00
|
|
|
super();
|
2017-05-16 16:35:52 +02:00
|
|
|
|
2015-03-26 16:06:53 +01:00
|
|
|
this.expressionType = ExpressionWrapperType.CONDITION_COLUMN_EXPRESSION;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.trId = trId;
|
2015-04-13 12:58:02 +02:00
|
|
|
this.columnData = columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.conditionExpressionContainer = conditionExpressionContainer;
|
|
|
|
this.replaceByValue = false;
|
|
|
|
this.replaceValue = null;
|
|
|
|
this.replaceExpressionContainer = null;
|
|
|
|
}
|
2017-05-16 16:35:52 +02:00
|
|
|
|
|
|
|
public ExpressionWrapper(String replaceValue, TRId trId, ColumnData columnData) {
|
2015-03-26 14:41:33 +01:00
|
|
|
super();
|
2015-03-26 16:06:53 +01:00
|
|
|
this.expressionType = ExpressionWrapperType.REPLACE_COLUMN_EXPRESSION;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.trId = trId;
|
2015-04-13 12:58:02 +02:00
|
|
|
this.columnData = columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.conditionExpressionContainer = null;
|
|
|
|
this.replaceByValue = true;
|
|
|
|
this.replaceValue = replaceValue;
|
|
|
|
this.replaceExpressionContainer = null;
|
|
|
|
}
|
2017-05-16 16:35:52 +02:00
|
|
|
|
|
|
|
public ExpressionWrapper(C_ExpressionContainer replaceExpressionContainer, TRId trId, ColumnData columnData) {
|
2015-03-26 14:41:33 +01:00
|
|
|
super();
|
2015-03-26 16:06:53 +01:00
|
|
|
this.expressionType = ExpressionWrapperType.REPLACE_COLUMN_EXPRESSION;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.trId = trId;
|
2015-04-13 12:58:02 +02:00
|
|
|
this.columnData = columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.conditionExpressionContainer = null;
|
|
|
|
this.replaceByValue = false;
|
|
|
|
this.replaceValue = null;
|
|
|
|
this.replaceExpressionContainer = replaceExpressionContainer;
|
|
|
|
}
|
2017-05-16 16:35:52 +02:00
|
|
|
|
|
|
|
public ExpressionWrapper(TRId trId, ColumnData columnData, C_ExpressionContainer conditionExpressionContainer,
|
2015-03-26 14:41:33 +01:00
|
|
|
C_ExpressionContainer replaceExpressionContainer) {
|
|
|
|
super();
|
2015-03-26 16:06:53 +01:00
|
|
|
this.expressionType = ExpressionWrapperType.CONDITION_AND_REPLACE_COLUMN_EXPRESSION;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.trId = trId;
|
2017-05-16 16:35:52 +02:00
|
|
|
this.columnData = columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.conditionExpressionContainer = conditionExpressionContainer;
|
|
|
|
this.replaceByValue = false;
|
|
|
|
this.replaceValue = null;
|
|
|
|
this.replaceExpressionContainer = replaceExpressionContainer;
|
|
|
|
}
|
2017-05-16 16:35:52 +02:00
|
|
|
|
|
|
|
public ExpressionWrapper(TRId trId, ColumnData columnData, C_ExpressionContainer conditionExpressionContainer,
|
2015-03-26 14:41:33 +01:00
|
|
|
String replaceValue) {
|
|
|
|
super();
|
2015-03-26 16:06:53 +01:00
|
|
|
this.expressionType = ExpressionWrapperType.CONDITION_AND_REPLACE_COLUMN_EXPRESSION;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.trId = trId;
|
2015-04-13 12:58:02 +02:00
|
|
|
this.columnData = columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
this.conditionExpressionContainer = conditionExpressionContainer;
|
|
|
|
this.replaceByValue = true;
|
|
|
|
this.replaceValue = replaceValue;
|
|
|
|
this.replaceExpressionContainer = null;
|
|
|
|
}
|
|
|
|
|
2015-03-26 16:06:53 +01:00
|
|
|
public ExpressionWrapperType getExpressionType() {
|
2015-03-26 14:41:33 +01:00
|
|
|
return expressionType;
|
|
|
|
}
|
|
|
|
|
2015-03-26 16:06:53 +01:00
|
|
|
public void setExpressionType(ExpressionWrapperType expressionType) {
|
2015-03-26 14:41:33 +01:00
|
|
|
this.expressionType = expressionType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public TRId getTrId() {
|
|
|
|
return trId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTrId(TRId trId) {
|
|
|
|
this.trId = trId;
|
|
|
|
}
|
|
|
|
|
2015-04-13 12:58:02 +02:00
|
|
|
public ColumnData getColumnData() {
|
|
|
|
return columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
}
|
|
|
|
|
2015-04-13 12:58:02 +02:00
|
|
|
public void setColumnData(ColumnData columnData) {
|
|
|
|
this.columnData = columnData;
|
2015-03-26 14:41:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public C_ExpressionContainer getConditionExpressionContainer() {
|
|
|
|
return conditionExpressionContainer;
|
|
|
|
}
|
|
|
|
|
2017-05-16 16:35:52 +02:00
|
|
|
public void setConditionExpressionContainer(C_ExpressionContainer conditionExpressionContainer) {
|
2015-03-26 14:41:33 +01:00
|
|
|
this.conditionExpressionContainer = conditionExpressionContainer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isReplaceByValue() {
|
|
|
|
return replaceByValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setReplaceByValue(boolean replaceByValue) {
|
|
|
|
this.replaceByValue = replaceByValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getReplaceValue() {
|
|
|
|
return replaceValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setReplaceValue(String replaceValue) {
|
|
|
|
this.replaceValue = replaceValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public C_ExpressionContainer getReplaceExpressionContainer() {
|
|
|
|
return replaceExpressionContainer;
|
|
|
|
}
|
|
|
|
|
2017-05-16 16:35:52 +02:00
|
|
|
public void setReplaceExpressionContainer(C_ExpressionContainer replaceExpressionContainer) {
|
2015-03-26 14:41:33 +01:00
|
|
|
this.replaceExpressionContainer = replaceExpressionContainer;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
2017-05-16 16:35:52 +02:00
|
|
|
return "ExpressionWrapper [expressionType=" + expressionType + ", trId=" + trId + ", columnData=" + columnData
|
|
|
|
+ ", conditionExpressionContainer=" + conditionExpressionContainer + ", replaceByValue="
|
|
|
|
+ replaceByValue + ", replaceValue=" + replaceValue + ", replaceExpressionContainer="
|
|
|
|
+ replaceExpressionContainer + "]";
|
2015-03-26 14:41:33 +01:00
|
|
|
}
|
2015-04-13 12:58:02 +02:00
|
|
|
|
2015-03-26 14:41:33 +01:00
|
|
|
}
|