当前位置: 首页>>代码示例>>Java>>正文


Java Function.getParameters方法代码示例

本文整理汇总了Java中net.sf.jsqlparser.expression.Function.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Java Function.getParameters方法的具体用法?Java Function.getParameters怎么用?Java Function.getParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jsqlparser.expression.Function的用法示例。


在下文中一共展示了Function.getParameters方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
public void visit(Function function) {
    if (function.isEscaped()) {
        buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginEscaped() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("{fn ");
    }
    buffer.append(function.getCommentName() != null ? function.getCommentName() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(function.getName());
    if (function.isAllColumns()) {
        buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(").append(function.getCommentBeginEscaped() != null ? function.getCommentAllColumns() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("*").append(function.getCommentBeginEscaped() != null ? function.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
    } else if (function.getParameters() == null) {
        buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(").append(function.getCommentEndEscaped() != null ? function.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
    } else {
        boolean oldUseBracketsInExprList = useBracketsInExprList;
        if (function.isDistinct()) {
            useBracketsInExprList = false;
            buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(").append(function.getCommentDistinct() != null ? function.getCommentDistinct() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Distinct ");
        }
        visit(function.getParameters());
        useBracketsInExprList = oldUseBracketsInExprList;
        if (function.isDistinct()) {
            buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
        }
    }
    if (function.isEscaped()) {
        buffer.append(function.getCommentEndEscaped() != null ? function.getCommentEndEscaped() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("}");
    }
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:26,代码来源:ExpressionDeParser.java

示例2: visit

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
@Override
public void visit(Function function) {
    function.setName(function.getName().toLowerCase());
    if (function.getParameters() != null) {
        function.getParameters().accept(this);
    }
}
 
开发者ID:diennea,项目名称:herddb,代码行数:8,代码来源:JdbcQueryRewriter.java

示例3: toAggregatedOutputColumn

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
public static Column toAggregatedOutputColumn(String fieldName, Function f) {
    if (f.getName().equalsIgnoreCase(BuiltinFunctions.COUNT)) {
        return Column.column(fieldName, ColumnTypes.LONG);
    }
    if (f.getName().equalsIgnoreCase(BuiltinFunctions.SUM) && f.getParameters() != null && f.getParameters().getExpressions() != null && f.getParameters().getExpressions().size() == 1) {
        return Column.column(fieldName, ColumnTypes.LONG);
    }
    if (f.getName().equalsIgnoreCase(BuiltinFunctions.MIN) && f.getParameters() != null && f.getParameters().getExpressions() != null && f.getParameters().getExpressions().size() == 1) {
        return Column.column(fieldName, ColumnTypes.LONG);
    }
    if (f.getName().equalsIgnoreCase(BuiltinFunctions.MAX) && f.getParameters() != null && f.getParameters().getExpressions() != null && f.getParameters().getExpressions().size() == 1) {
        return Column.column(fieldName, ColumnTypes.LONG);
    }
    return null;
}
 
开发者ID:diennea,项目名称:herddb,代码行数:16,代码来源:BuiltinFunctions.java

示例4: getColumnCalculator

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
public static AggregatedColumnCalculator getColumnCalculator(Function f, String fieldName,
    StatementEvaluationContext context) throws StatementExecutionException {
    String functionName = f.getName();
    CompiledSQLExpression firstParam = f.getParameters() == null || f.getParameters().getExpressions() == null || f.getParameters().getExpressions().isEmpty() ? null
        : SQLExpressionCompiler.compileExpression(null, f.getParameters().getExpressions().get(0));
    return getColumnCalculator(functionName, fieldName, firstParam, context);
}
 
开发者ID:diennea,项目名称:herddb,代码行数:8,代码来源:BuiltinFunctions.java

示例5: visit

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
@Override
public void visit(Function fnctn) {
    if (fnctn.getParameters() != null) {
        for (Iterator it = fnctn.getParameters().getExpressions().iterator(); it.hasNext();) {
            ((Expression) it.next()).accept(this);
        }
    }
}
 
开发者ID:valdasraps,项目名称:resthub,代码行数:9,代码来源:AbstractAllParser.java

示例6: visit

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
@Override
public void visit(Function function) {
    if (function.isEscaped()) {
        buffer.append("{fn ");
    }

    buffer.append(function.getName());
    if (function.isAllColumns() && function.getParameters() == null) {
        buffer.append("(*)");
    } else if (function.getParameters() == null) {
        buffer.append("()");
    } else {
        boolean oldUseBracketsInExprList = useBracketsInExprList;
        if (function.isDistinct()) {
            useBracketsInExprList = false;
            buffer.append("(DISTINCT ");
        } else if (function.isAllColumns()) {
            useBracketsInExprList = false;
            buffer.append("(ALL ");
        }
        visit(function.getParameters());
        useBracketsInExprList = oldUseBracketsInExprList;
        if (function.isDistinct() || function.isAllColumns()) {
            buffer.append(")");
        }
    }

    if (function.getAttribute() != null) {
        buffer.append(".").append(function.getAttribute());
    }
    if (function.getKeep() != null) {
        buffer.append(" ").append(function.getKeep());
    }

    if (function.isEscaped()) {
        buffer.append("}");
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:39,代码来源:ExpressionDeParser.java

示例7: visit

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
@Override
public void visit(Function function) {
    ExpressionList exprList = function.getParameters();
    if (exprList != null) {
        visit(exprList);
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:8,代码来源:TablesNamesFinder.java

示例8: create

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
public static CompiledFunction create(Function f, String validatedTableAlias) {
    String name = f.getName();
    List<Expression> params = null;
    if (f.getParameters() != null) {
        params = f.getParameters().getExpressions();
    }

    switch (name) {
        case BuiltinFunctions.COUNT:
        case BuiltinFunctions.SUM:
        case BuiltinFunctions.MIN:
        case BuiltinFunctions.MAX:
            // AGGREGATED FUNCTION
            return new CompiledFunction(name, null);
        case BuiltinFunctions.LOWER: {
            if (params == null || params.size() != 1) {
                throw new StatementExecutionException("function " + name + " must have one parameter");
            }
            break;
        }
        case BuiltinFunctions.UPPER: {
            if (params == null || params.size() != 1) {
                throw new StatementExecutionException("function " + name + " must have one parameter");
            }
            break;
        }
        case BuiltinFunctions.ABS: {
            if (params == null || params.size() != 1) {
                throw new StatementExecutionException("function " + name + " must have one parameter");
            }
            break;
        }
        case BuiltinFunctions.ROUND: {
            if (params == null || (params.size() != 1 && params.size() != 2)) {
                throw new StatementExecutionException("function " + name + " must have one or two parameters");
            }
            break;
        }
        default:
            throw new StatementExecutionException("unhandled function " + name);
    }

    List<CompiledSQLExpression> compiledParams = new ArrayList<>();
    for (Expression exp : f.getParameters().getExpressions()) {
        compiledParams.add(compileExpression(validatedTableAlias, exp));
    }

    return new CompiledFunction(name, compiledParams);

}
 
开发者ID:diennea,项目名称:herddb,代码行数:51,代码来源:CompiledFunction.java

示例9: visit

import net.sf.jsqlparser.expression.Function; //导入方法依赖的package包/类
@Override
public void visit(Function fnctn) {
    if (fnctn.getParameters() != null && fnctn.getParameters().getExpressions() != null) {
        fnctn.getParameters().getExpressions().forEach(e -> e.accept(this));
    }
}
 
开发者ID:diennea,项目名称:herddb,代码行数:7,代码来源:ColumnReferencesDiscovery.java


注:本文中的net.sf.jsqlparser.expression.Function.getParameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。