Minor Updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@92767 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
61d7e8b579
commit
74d17d8b1c
|
@ -165,127 +165,145 @@ public class C_ExpressionParser {
|
||||||
|
|
||||||
private Expression getValueIsIn(C_Expression exp) {
|
private Expression getValueIsIn(C_Expression exp) {
|
||||||
C_ValueIsIn v = (C_ValueIsIn) exp;
|
C_ValueIsIn v = (C_ValueIsIn) exp;
|
||||||
ValueIsIn valueIsIn = new ValueIsIn(parse(v.getLeftArgument()), parse(v.getRightArgument()));
|
ValueIsIn valueIsIn = new ValueIsIn(parse(v.getLeftArgument()),
|
||||||
|
parse(v.getRightArgument()));
|
||||||
return valueIsIn;
|
return valueIsIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getOr(C_Expression exp) {
|
private Expression getOr(C_Expression exp) {
|
||||||
C_Or o= (C_Or) exp;
|
C_Or o = (C_Or) exp;
|
||||||
List<C_Expression> listCExp=o.getArguments();
|
List<C_Expression> listCExp = o.getArguments();
|
||||||
List<Expression> listExp=new ArrayList<Expression>();
|
List<Expression> listExp = new ArrayList<Expression>();
|
||||||
Expression ex;
|
Expression ex;
|
||||||
for(C_Expression cexp: listCExp){
|
for (C_Expression cexp : listCExp) {
|
||||||
ex= parse(cexp);
|
ex = parse(cexp);
|
||||||
listExp.add(ex);
|
listExp.add(ex);
|
||||||
}
|
}
|
||||||
Or or=new Or(listExp);
|
Or or = new Or(listExp);
|
||||||
return or;
|
return or;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getNot(C_Expression exp) {
|
private Expression getNot(C_Expression exp) {
|
||||||
C_Not n= (C_Not) exp;
|
C_Not n = (C_Not) exp;
|
||||||
Not not=new Not(parse(n.getArgument()));
|
Not not = new Not(parse(n.getArgument()));
|
||||||
return not;
|
return not;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getIsNull(C_Expression exp) {
|
private Expression getIsNull(C_Expression exp) {
|
||||||
C_IsNull nullIs= (C_IsNull) exp;
|
C_IsNull nullIs = (C_IsNull) exp;
|
||||||
IsNull isNull=new IsNull(parse(nullIs.getArgument()));
|
IsNull isNull = new IsNull(parse(nullIs.getArgument()));
|
||||||
return isNull;
|
return isNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getIsNotNull(C_Expression exp) {
|
private Expression getIsNotNull(C_Expression exp) {
|
||||||
C_IsNotNull nullNotIs= (C_IsNotNull) exp;
|
C_IsNotNull nullNotIs = (C_IsNotNull) exp;
|
||||||
IsNotNull isNotNull=new IsNotNull(parse(nullNotIs.getArgument()));
|
IsNotNull isNotNull = new IsNotNull(parse(nullNotIs.getArgument()));
|
||||||
return isNotNull;
|
return isNotNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getBetween(C_Expression exp) {
|
private Expression getBetween(C_Expression exp) {
|
||||||
C_Between bet= (C_Between) exp;
|
C_Between bet = (C_Between) exp;
|
||||||
Between between=new Between(parse(bet.getLeftArgument()),parse(bet.getRightArgument()));
|
Between between = new Between(parse(bet.getLeftArgument()),
|
||||||
|
parse(bet.getRightArgument()));
|
||||||
return between;
|
return between;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getAnd(C_Expression exp) {
|
private Expression getAnd(C_Expression exp) {
|
||||||
C_And o= (C_And) exp;
|
C_And o = (C_And) exp;
|
||||||
List<C_Expression> listCExp=o.getArguments();
|
List<C_Expression> listCExp = o.getArguments();
|
||||||
List<Expression> listExp=new ArrayList<Expression>();
|
List<Expression> listExp = new ArrayList<Expression>();
|
||||||
Expression ex;
|
Expression ex;
|
||||||
for(C_Expression cexp: listCExp){
|
for (C_Expression cexp : listCExp) {
|
||||||
ex= parse(cexp);
|
ex = parse(cexp);
|
||||||
listExp.add(ex);
|
listExp.add(ex);
|
||||||
}
|
}
|
||||||
And and=new And(listExp);
|
And and = new And(listExp);
|
||||||
return and;
|
return and;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getTextMatchSQLRegexp(C_Expression exp) {
|
private Expression getTextMatchSQLRegexp(C_Expression exp) {
|
||||||
C_TextMatchSQLRegexp reg= (C_TextMatchSQLRegexp) exp;
|
C_TextMatchSQLRegexp reg = (C_TextMatchSQLRegexp) exp;
|
||||||
TextMatchSQLRegexp regExp=new TextMatchSQLRegexp(parse(reg.getLeftArgument()),parse(reg.getRightArgument()));
|
TextMatchSQLRegexp regExp = new TextMatchSQLRegexp(
|
||||||
|
parse(reg.getLeftArgument()), parse(reg.getRightArgument()));
|
||||||
return regExp;
|
return regExp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getTextEndWith(C_Expression exp) {
|
private Expression getTextEndWith(C_Expression exp) {
|
||||||
C_TextEndsWith textEnd= (C_TextEndsWith) exp;
|
C_TextEndsWith textEnd = (C_TextEndsWith) exp;
|
||||||
TextEndsWith textEndWith=new TextEndsWith(parse(textEnd.getLeftArgument()),parse(textEnd.getRightArgument()));
|
TextEndsWith textEndWith = new TextEndsWith(
|
||||||
|
parse(textEnd.getLeftArgument()),
|
||||||
|
parse(textEnd.getRightArgument()));
|
||||||
return textEndWith;
|
return textEndWith;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getTextContains(C_Expression exp) {
|
private Expression getTextContains(C_Expression exp) {
|
||||||
C_TextContains textContains= (C_TextContains) exp;
|
C_TextContains textContains = (C_TextContains) exp;
|
||||||
TextContains textCont=new TextContains(parse(textContains.getLeftArgument()),parse(textContains.getRightArgument()));
|
TextContains textCont = new TextContains(
|
||||||
|
parse(textContains.getLeftArgument()),
|
||||||
|
parse(textContains.getRightArgument()));
|
||||||
return textCont;
|
return textCont;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getTextBeginWith(C_Expression exp) {
|
private Expression getTextBeginWith(C_Expression exp) {
|
||||||
C_TextBeginsWith textB= (C_TextBeginsWith) exp;
|
C_TextBeginsWith textB = (C_TextBeginsWith) exp;
|
||||||
TextBeginsWith textBegins=new TextBeginsWith(parse(textB.getLeftArgument()),parse(textB.getRightArgument()));
|
TextBeginsWith textBegins = new TextBeginsWith(
|
||||||
|
parse(textB.getLeftArgument()), parse(textB.getRightArgument()));
|
||||||
return textBegins;
|
return textBegins;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getNotLess(C_Expression exp) {
|
private Expression getNotLess(C_Expression exp) {
|
||||||
C_NotLess notL= (C_NotLess) exp;
|
C_NotLess notL = (C_NotLess) exp;
|
||||||
NotLess notLess=new NotLess(parse(notL.getLeftArgument()),parse(notL.getRightArgument()));
|
NotLess notLess = new NotLess(parse(notL.getLeftArgument()),
|
||||||
|
parse(notL.getRightArgument()));
|
||||||
return notLess;
|
return notLess;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getNotGreater(C_Expression exp) {
|
private Expression getNotGreater(C_Expression exp) {
|
||||||
C_NotGreater notG= (C_NotGreater) exp;
|
C_NotGreater notG = (C_NotGreater) exp;
|
||||||
NotGreater notGreater=new NotGreater(parse(notG.getLeftArgument()),parse(notG.getRightArgument()));
|
NotGreater notGreater = new NotGreater(parse(notG.getLeftArgument()),
|
||||||
|
parse(notG.getRightArgument()));
|
||||||
return notGreater;
|
return notGreater;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getNotEquals(C_Expression exp) {
|
private Expression getNotEquals(C_Expression exp) {
|
||||||
C_NotEquals notE= (C_NotEquals) exp;
|
C_NotEquals notE = (C_NotEquals) exp;
|
||||||
NotEquals notEquals=new NotEquals(parse(notE.getLeftArgument()),parse(notE.getRightArgument()));
|
NotEquals notEquals = new NotEquals(parse(notE.getLeftArgument()),
|
||||||
|
parse(notE.getRightArgument()));
|
||||||
return notEquals;
|
return notEquals;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getLessThan(C_Expression exp) {
|
private Expression getLessThan(C_Expression exp) {
|
||||||
C_LessThan lessT= (C_LessThan) exp;
|
C_LessThan lessT = (C_LessThan) exp;
|
||||||
LessThan lessThan=new LessThan(parse(lessT.getLeftArgument()),parse(lessT.getRightArgument()));
|
LessThan lessThan = new LessThan(parse(lessT.getLeftArgument()),
|
||||||
|
parse(lessT.getRightArgument()));
|
||||||
return lessThan;
|
return lessThan;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getLessOrEquals(C_Expression exp) {
|
private Expression getLessOrEquals(C_Expression exp) {
|
||||||
C_LessOrEquals lessOrE= (C_LessOrEquals) exp;
|
C_LessOrEquals lessOrE = (C_LessOrEquals) exp;
|
||||||
LessOrEquals lessOrEquals=new LessOrEquals(parse(lessOrE.getLeftArgument()),parse(lessOrE.getRightArgument()));
|
LessOrEquals lessOrEquals = new LessOrEquals(
|
||||||
|
parse(lessOrE.getLeftArgument()),
|
||||||
|
parse(lessOrE.getRightArgument()));
|
||||||
return lessOrEquals;
|
return lessOrEquals;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getGreaterThan(C_Expression exp) {
|
private Expression getGreaterThan(C_Expression exp) {
|
||||||
C_GreaterThan greaterThan= (C_GreaterThan) exp;
|
C_GreaterThan greaterThan = (C_GreaterThan) exp;
|
||||||
GreaterThan greater=new GreaterThan(parse(greaterThan.getLeftArgument()),parse(greaterThan.getRightArgument()));
|
GreaterThan greater = new GreaterThan(
|
||||||
|
parse(greaterThan.getLeftArgument()),
|
||||||
|
parse(greaterThan.getRightArgument()));
|
||||||
return greater;
|
return greater;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression getGreaterOrEquals(C_Expression exp) {
|
private Expression getGreaterOrEquals(C_Expression exp) {
|
||||||
C_GreaterOrEquals greaterOrEq= (C_GreaterOrEquals) exp;
|
C_GreaterOrEquals greaterOrEq = (C_GreaterOrEquals) exp;
|
||||||
GreaterOrEquals greaterOrEquals=new GreaterOrEquals(parse(greaterOrEq.getLeftArgument()),parse(greaterOrEq.getRightArgument()));
|
GreaterOrEquals greaterOrEquals = new GreaterOrEquals(
|
||||||
|
parse(greaterOrEq.getLeftArgument()),
|
||||||
|
parse(greaterOrEq.getRightArgument()));
|
||||||
return greaterOrEquals;
|
return greaterOrEquals;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TDTypeValue getExpressionValue(TD_Value value) {
|
protected TDTypeValue getExpressionValue(TD_Value value) {
|
||||||
|
@ -373,30 +391,27 @@ public class C_ExpressionParser {
|
||||||
|
|
||||||
protected Expression getRange(C_Expression exp) {
|
protected Expression getRange(C_Expression exp) {
|
||||||
C_Range c = (C_Range) exp;
|
C_Range c = (C_Range) exp;
|
||||||
Range range = new Range(getExpressionValue(c.getMaximum()),
|
Range range = new Range(getExpressionValue(c.getMinimum()),
|
||||||
getExpressionValue(c.getMinimum()));
|
getExpressionValue(c.getMaximum()));
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Expression getTypedColumnReference(C_Expression exp) {
|
protected Expression getTypedColumnReference(C_Expression exp) {
|
||||||
C_TypedColumnReference c = (C_TypedColumnReference) exp;
|
C_TypedColumnReference c = (C_TypedColumnReference) exp;
|
||||||
TableId tableId=new TableId(Long.valueOf(c.getTrId().getTableId()));
|
TableId tableId = new TableId(Long.valueOf(c.getTrId().getTableId()));
|
||||||
ColumnLocalId columnId=new ColumnLocalId(c.getColumnId());
|
ColumnLocalId columnId = new ColumnLocalId(c.getColumnId());
|
||||||
|
|
||||||
TypedColumnReference ref = new TypedColumnReference(
|
TypedColumnReference ref = new TypedColumnReference(tableId, columnId,
|
||||||
tableId,
|
|
||||||
columnId,
|
|
||||||
mapColumnDataType(c.getDataType()));
|
mapColumnDataType(c.getDataType()));
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Expression getEquals(C_Expression exp) {
|
protected Expression getEquals(C_Expression exp) {
|
||||||
C_Equals e = (C_Equals) exp;
|
C_Equals e = (C_Equals) exp;
|
||||||
Expression left=parse(e.getLeftArgument());
|
Expression left = parse(e.getLeftArgument());
|
||||||
Expression right=parse(e.getRightArgument());
|
Expression right = parse(e.getRightArgument());
|
||||||
Equals eq = new Equals(left,right);
|
Equals eq = new Equals(left, right);
|
||||||
return eq;
|
return eq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue