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) {
|
||||
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;
|
||||
}
|
||||
|
||||
private Expression getOr(C_Expression exp) {
|
||||
C_Or o= (C_Or) exp;
|
||||
List<C_Expression> listCExp=o.getArguments();
|
||||
List<Expression> listExp=new ArrayList<Expression>();
|
||||
C_Or o = (C_Or) exp;
|
||||
List<C_Expression> listCExp = o.getArguments();
|
||||
List<Expression> listExp = new ArrayList<Expression>();
|
||||
Expression ex;
|
||||
for(C_Expression cexp: listCExp){
|
||||
ex= parse(cexp);
|
||||
for (C_Expression cexp : listCExp) {
|
||||
ex = parse(cexp);
|
||||
listExp.add(ex);
|
||||
}
|
||||
Or or=new Or(listExp);
|
||||
Or or = new Or(listExp);
|
||||
return or;
|
||||
}
|
||||
|
||||
private Expression getNot(C_Expression exp) {
|
||||
C_Not n= (C_Not) exp;
|
||||
Not not=new Not(parse(n.getArgument()));
|
||||
C_Not n = (C_Not) exp;
|
||||
Not not = new Not(parse(n.getArgument()));
|
||||
return not;
|
||||
}
|
||||
|
||||
private Expression getIsNull(C_Expression exp) {
|
||||
C_IsNull nullIs= (C_IsNull) exp;
|
||||
IsNull isNull=new IsNull(parse(nullIs.getArgument()));
|
||||
C_IsNull nullIs = (C_IsNull) exp;
|
||||
IsNull isNull = new IsNull(parse(nullIs.getArgument()));
|
||||
return isNull;
|
||||
}
|
||||
|
||||
private Expression getIsNotNull(C_Expression exp) {
|
||||
C_IsNotNull nullNotIs= (C_IsNotNull) exp;
|
||||
IsNotNull isNotNull=new IsNotNull(parse(nullNotIs.getArgument()));
|
||||
C_IsNotNull nullNotIs = (C_IsNotNull) exp;
|
||||
IsNotNull isNotNull = new IsNotNull(parse(nullNotIs.getArgument()));
|
||||
return isNotNull;
|
||||
}
|
||||
|
||||
private Expression getBetween(C_Expression exp) {
|
||||
C_Between bet= (C_Between) exp;
|
||||
Between between=new Between(parse(bet.getLeftArgument()),parse(bet.getRightArgument()));
|
||||
C_Between bet = (C_Between) exp;
|
||||
Between between = new Between(parse(bet.getLeftArgument()),
|
||||
parse(bet.getRightArgument()));
|
||||
return between;
|
||||
}
|
||||
|
||||
private Expression getAnd(C_Expression exp) {
|
||||
C_And o= (C_And) exp;
|
||||
List<C_Expression> listCExp=o.getArguments();
|
||||
List<Expression> listExp=new ArrayList<Expression>();
|
||||
C_And o = (C_And) exp;
|
||||
List<C_Expression> listCExp = o.getArguments();
|
||||
List<Expression> listExp = new ArrayList<Expression>();
|
||||
Expression ex;
|
||||
for(C_Expression cexp: listCExp){
|
||||
ex= parse(cexp);
|
||||
for (C_Expression cexp : listCExp) {
|
||||
ex = parse(cexp);
|
||||
listExp.add(ex);
|
||||
}
|
||||
And and=new And(listExp);
|
||||
And and = new And(listExp);
|
||||
return and;
|
||||
}
|
||||
|
||||
private Expression getTextMatchSQLRegexp(C_Expression exp) {
|
||||
C_TextMatchSQLRegexp reg= (C_TextMatchSQLRegexp) exp;
|
||||
TextMatchSQLRegexp regExp=new TextMatchSQLRegexp(parse(reg.getLeftArgument()),parse(reg.getRightArgument()));
|
||||
C_TextMatchSQLRegexp reg = (C_TextMatchSQLRegexp) exp;
|
||||
TextMatchSQLRegexp regExp = new TextMatchSQLRegexp(
|
||||
parse(reg.getLeftArgument()), parse(reg.getRightArgument()));
|
||||
return regExp;
|
||||
|
||||
}
|
||||
|
||||
private Expression getTextEndWith(C_Expression exp) {
|
||||
C_TextEndsWith textEnd= (C_TextEndsWith) exp;
|
||||
TextEndsWith textEndWith=new TextEndsWith(parse(textEnd.getLeftArgument()),parse(textEnd.getRightArgument()));
|
||||
C_TextEndsWith textEnd = (C_TextEndsWith) exp;
|
||||
TextEndsWith textEndWith = new TextEndsWith(
|
||||
parse(textEnd.getLeftArgument()),
|
||||
parse(textEnd.getRightArgument()));
|
||||
return textEndWith;
|
||||
}
|
||||
|
||||
private Expression getTextContains(C_Expression exp) {
|
||||
C_TextContains textContains= (C_TextContains) exp;
|
||||
TextContains textCont=new TextContains(parse(textContains.getLeftArgument()),parse(textContains.getRightArgument()));
|
||||
C_TextContains textContains = (C_TextContains) exp;
|
||||
TextContains textCont = new TextContains(
|
||||
parse(textContains.getLeftArgument()),
|
||||
parse(textContains.getRightArgument()));
|
||||
return textCont;
|
||||
}
|
||||
|
||||
private Expression getTextBeginWith(C_Expression exp) {
|
||||
C_TextBeginsWith textB= (C_TextBeginsWith) exp;
|
||||
TextBeginsWith textBegins=new TextBeginsWith(parse(textB.getLeftArgument()),parse(textB.getRightArgument()));
|
||||
C_TextBeginsWith textB = (C_TextBeginsWith) exp;
|
||||
TextBeginsWith textBegins = new TextBeginsWith(
|
||||
parse(textB.getLeftArgument()), parse(textB.getRightArgument()));
|
||||
return textBegins;
|
||||
}
|
||||
|
||||
private Expression getNotLess(C_Expression exp) {
|
||||
C_NotLess notL= (C_NotLess) exp;
|
||||
NotLess notLess=new NotLess(parse(notL.getLeftArgument()),parse(notL.getRightArgument()));
|
||||
C_NotLess notL = (C_NotLess) exp;
|
||||
NotLess notLess = new NotLess(parse(notL.getLeftArgument()),
|
||||
parse(notL.getRightArgument()));
|
||||
return notLess;
|
||||
}
|
||||
|
||||
private Expression getNotGreater(C_Expression exp) {
|
||||
C_NotGreater notG= (C_NotGreater) exp;
|
||||
NotGreater notGreater=new NotGreater(parse(notG.getLeftArgument()),parse(notG.getRightArgument()));
|
||||
C_NotGreater notG = (C_NotGreater) exp;
|
||||
NotGreater notGreater = new NotGreater(parse(notG.getLeftArgument()),
|
||||
parse(notG.getRightArgument()));
|
||||
return notGreater;
|
||||
}
|
||||
|
||||
private Expression getNotEquals(C_Expression exp) {
|
||||
C_NotEquals notE= (C_NotEquals) exp;
|
||||
NotEquals notEquals=new NotEquals(parse(notE.getLeftArgument()),parse(notE.getRightArgument()));
|
||||
C_NotEquals notE = (C_NotEquals) exp;
|
||||
NotEquals notEquals = new NotEquals(parse(notE.getLeftArgument()),
|
||||
parse(notE.getRightArgument()));
|
||||
return notEquals;
|
||||
}
|
||||
|
||||
private Expression getLessThan(C_Expression exp) {
|
||||
C_LessThan lessT= (C_LessThan) exp;
|
||||
LessThan lessThan=new LessThan(parse(lessT.getLeftArgument()),parse(lessT.getRightArgument()));
|
||||
C_LessThan lessT = (C_LessThan) exp;
|
||||
LessThan lessThan = new LessThan(parse(lessT.getLeftArgument()),
|
||||
parse(lessT.getRightArgument()));
|
||||
return lessThan;
|
||||
}
|
||||
|
||||
private Expression getLessOrEquals(C_Expression exp) {
|
||||
C_LessOrEquals lessOrE= (C_LessOrEquals) exp;
|
||||
LessOrEquals lessOrEquals=new LessOrEquals(parse(lessOrE.getLeftArgument()),parse(lessOrE.getRightArgument()));
|
||||
C_LessOrEquals lessOrE = (C_LessOrEquals) exp;
|
||||
LessOrEquals lessOrEquals = new LessOrEquals(
|
||||
parse(lessOrE.getLeftArgument()),
|
||||
parse(lessOrE.getRightArgument()));
|
||||
return lessOrEquals;
|
||||
}
|
||||
|
||||
private Expression getGreaterThan(C_Expression exp) {
|
||||
C_GreaterThan greaterThan= (C_GreaterThan) exp;
|
||||
GreaterThan greater=new GreaterThan(parse(greaterThan.getLeftArgument()),parse(greaterThan.getRightArgument()));
|
||||
C_GreaterThan greaterThan = (C_GreaterThan) exp;
|
||||
GreaterThan greater = new GreaterThan(
|
||||
parse(greaterThan.getLeftArgument()),
|
||||
parse(greaterThan.getRightArgument()));
|
||||
return greater;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private Expression getGreaterOrEquals(C_Expression exp) {
|
||||
C_GreaterOrEquals greaterOrEq= (C_GreaterOrEquals) exp;
|
||||
GreaterOrEquals greaterOrEquals=new GreaterOrEquals(parse(greaterOrEq.getLeftArgument()),parse(greaterOrEq.getRightArgument()));
|
||||
C_GreaterOrEquals greaterOrEq = (C_GreaterOrEquals) exp;
|
||||
GreaterOrEquals greaterOrEquals = new GreaterOrEquals(
|
||||
parse(greaterOrEq.getLeftArgument()),
|
||||
parse(greaterOrEq.getRightArgument()));
|
||||
return greaterOrEquals;
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected TDTypeValue getExpressionValue(TD_Value value) {
|
||||
|
@ -373,30 +391,27 @@ public class C_ExpressionParser {
|
|||
|
||||
protected Expression getRange(C_Expression exp) {
|
||||
C_Range c = (C_Range) exp;
|
||||
Range range = new Range(getExpressionValue(c.getMaximum()),
|
||||
getExpressionValue(c.getMinimum()));
|
||||
Range range = new Range(getExpressionValue(c.getMinimum()),
|
||||
getExpressionValue(c.getMaximum()));
|
||||
return range;
|
||||
}
|
||||
|
||||
protected Expression getTypedColumnReference(C_Expression exp) {
|
||||
C_TypedColumnReference c = (C_TypedColumnReference) exp;
|
||||
TableId tableId=new TableId(Long.valueOf(c.getTrId().getTableId()));
|
||||
ColumnLocalId columnId=new ColumnLocalId(c.getColumnId());
|
||||
|
||||
TypedColumnReference ref = new TypedColumnReference(
|
||||
tableId,
|
||||
columnId,
|
||||
TableId tableId = new TableId(Long.valueOf(c.getTrId().getTableId()));
|
||||
ColumnLocalId columnId = new ColumnLocalId(c.getColumnId());
|
||||
|
||||
TypedColumnReference ref = new TypedColumnReference(tableId, columnId,
|
||||
mapColumnDataType(c.getDataType()));
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
||||
protected Expression getEquals(C_Expression exp) {
|
||||
C_Equals e = (C_Equals) exp;
|
||||
Expression left=parse(e.getLeftArgument());
|
||||
Expression right=parse(e.getRightArgument());
|
||||
Equals eq = new Equals(left,right);
|
||||
Expression left = parse(e.getLeftArgument());
|
||||
Expression right = parse(e.getRightArgument());
|
||||
Equals eq = new Equals(left, right);
|
||||
return eq;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue