return super.virtualMethodCallValue(val, in);
}
@Override public ColumnExpressions<?> staticMethodCallValue(MethodCallValue.StaticMethodCallValue val, SymbExPassDown in) throws TypedValueVisitorException
{
MethodSignature sig = val.getSignature();
if (sig.equals(TransformationClassAnalyzer.integerValueOf)
|| sig.equals(TransformationClassAnalyzer.longValueOf)
|| sig.equals(TransformationClassAnalyzer.doubleValueOf)
|| sig.equals(TransformationClassAnalyzer.booleanValueOf))
{
// Integer.valueOf() to be like a cast and assume it's correct
SymbExPassDown passdown = SymbExPassDown.with(val, in.isExpectingConditional);
ColumnExpressions<?> base = val.args.get(0).visit(this, passdown);
return base;
}
else if (sig.equals(TransformationClassAnalyzer.bigIntegerValueOfLong))
{
throw new TypedValueVisitorException("New BigIntegers can only be created in the context of numeric promotion");
}
else if (sig.equals(MethodChecker.stringValueOfObject))
{
if (!val.args.get(0).getType().equals(Type.getObjectType("java/lang/String")))
throw new TypedValueVisitorException("Do not know how to convert type " + val.args.get(0).getType() + " to a string");
SymbExPassDown passdown = SymbExPassDown.with(val, in.isExpectingConditional);
ColumnExpressions<?> base = val.args.get(0).visit(this, passdown);
return base;
}
else if (MethodChecker.jpqlFunctionStaticMethods.contains(sig))
{
if (sig.equals(MethodChecker.jpqlLike))
{
SymbExPassDown passdown = SymbExPassDown.with(val, in.isExpectingConditional);
ColumnExpressions<?> base = val.args.get(0).visit(this, passdown);
ColumnExpressions<?> pattern = val.args.get(1).visit(this, passdown);
return ColumnExpressions.singleColumn(new SimpleRowReader<>(),
new BinaryExpression("LIKE", base.getOnlyColumn(), pattern.getOnlyColumn()));
}
else if (sig.equals(MethodChecker.mathAbsDouble)
|| sig.equals(MethodChecker.mathAbsInt)
|| sig.equals(MethodChecker.mathAbsLong))
{
SymbExPassDown passdown = SymbExPassDown.with(val, in.isExpectingConditional);
ColumnExpressions<?> base = val.args.get(0).visit(this, passdown);
return ColumnExpressions.singleColumn(base.reader,
FunctionExpression.singleParam("ABS", base.getOnlyColumn()));
}
else if (sig.equals(MethodChecker.mathSqrt))
{
SymbExPassDown passdown = SymbExPassDown.with(val, in.isExpectingConditional);
TypedValue baseVal = val.args.get(0);
if (isWideningCast(baseVal))
baseVal = skipWideningCast(baseVal);