net.sf.jsqlparser.expression.Function.getParameters()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中net.sf.jsqlparser.expression.Function.getParameters()方法的一些代码示例,展示了Function.getParameters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.getParameters()方法的具体详情如下:
包路径:net.sf.jsqlparser.expression.Function
类名称:Function
方法名:getParameters

Function.getParameters介绍

[英]The list of parameters of the function (if any, else null) If the parameter is "", allColumns is set to true
[中]函数的参数列表(如果有,否则为null)。如果参数为“
”,则allColumns设置为true

代码示例

代码示例来源:origin: JSQLParser/JSqlParser

@Override
public void visit(Function function) {
  ExpressionList exprList = function.getParameters();
  if (exprList != null) {
    visit(exprList);
  }
}

代码示例来源:origin: JSQLParser/JSqlParser

@Override
public void visit(Function function) {
  if (function.getParameters() != null) {
    function.getParameters().accept(this);
  }
  if (function.getKeep() != null) {
    function.getKeep().accept(this);
  }
}

代码示例来源:origin: alibaba/mdrill

public void visit(Function function) {
  if (function.isEscaped()) {
    buffer.append("{fn ");
  }
  buffer.append(function.getName());
  if (function.isAllColumns()) {
    buffer.append("(*)");
  } else if (function.getParameters() == null) {
    buffer.append("()");
  } else {
    boolean oldUseBracketsInExprList = useBracketsInExprList;
    if (function.isDistinct()) {
      useBracketsInExprList = false;
      buffer.append("(DISTINCT ");
    }
    visit(function.getParameters());
    useBracketsInExprList = oldUseBracketsInExprList;
    if (function.isDistinct()) {
      buffer.append(")");
    }
  }
  if (function.isEscaped()) {
    buffer.append("}");
  }
}

代码示例来源:origin: JSQLParser/JSqlParser

if (function.isAllColumns() && function.getParameters() == null) {
  buffer.append("(*)");
} else if (function.getParameters() == null && function.getNamedParameters() == null) {
  buffer.append("()");
} else {
    visit(function.getNamedParameters());
  if(function.getParameters() != null){
    visit(function.getParameters());

代码示例来源:origin: geotools/geotools

public void visit(Function function) {
  Function qfunction = new Function();
  qfunction.setAllColumns(function.isAllColumns());
  qfunction.setEscaped(function.isEscaped());
  qfunction.setName(function.getName());
  ExpressionList parameters = function.getParameters();
  ExpressionList qualifiedParams;
  qualifiedParams =
      (ExpressionList) ItemsListQualifier.qualify(session, tableAliases, parameters);
  qfunction.setParameters(qualifiedParams);
  this._qualifiedExpression = qfunction;
}

代码示例来源:origin: com.github.jsqlparser/jsqlparser

@Override
public void visit(Function function) {
  ExpressionList exprList = function.getParameters();
  if (exprList != null) {
    visit(exprList);
  }
}

代码示例来源:origin: ontop/ontop

@Override
public void visit(Function function) {
  if (function.getParameters() != null)
    for (Expression ex : function.getParameters().getExpressions())
      ex.accept(this);
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-mapping-sql-core

@Override
public void visit(Function function) {
  if (function.getParameters() != null)
    for (Expression ex : function.getParameters().getExpressions())
      ex.accept(this);
}

代码示例来源:origin: ddf-project/DDF

public void visit(Function function) throws Exception {
  if (function.getParameters() == null) return;
  for (Expression exp : function.getParameters().getExpressions()) {
    exp.accept(this);
  }
}

代码示例来源:origin: diennea/herddb

@Override
public void visit(Function fnctn) {
  if (fnctn.getParameters() != null && fnctn.getParameters().getExpressions() != null) {
    fnctn.getParameters().getExpressions().forEach(e -> e.accept(this));
  }
}

代码示例来源:origin: org.opencadc/cadc-adql

@Override
public void visit(Function function)
{
  log.debug("visit(function)" + function);
  selectNavigator.enterFunctionCall(function);
  if (function.getParameters() != null)
    function.getParameters().accept(this);
  selectNavigator.leaveFunctionCall();
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-mapping-sql-core

@Override
public void visit(net.sf.jsqlparser.expression.Function expression) {
  // do not use ImmutableCollectors.toList because this cannot be done concurrently
  ImmutableList<Term> terms = (expression.getParameters() != null)
      ? ImmutableList.<Term>builder()
      .addAll(expression.getParameters().getExpressions().stream()
          .map(t -> termVisitor.getTerm(t)).iterator())
      .build()
      : ImmutableList.of();
  BiFunction<ImmutableList<Term>, net.sf.jsqlparser.expression.Function, Function> function
      = BOOLEAN_FUNCTIONS.get(expression.getName().toUpperCase());
  if (function == null)
    throw new UnsupportedSelectQueryRuntimeException("Unsupported SQL function", expression);
  result = ImmutableList.of(function.apply(terms, expression));
}

代码示例来源:origin: diennea/herddb

@Override
public void visit(Function function) {
  function.setName(function.getName().toLowerCase());
  if (function.getParameters() != null) {
    function.getParameters().accept(this);
  }
}

代码示例来源:origin: diennea/herddb

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);
}

代码示例来源:origin: org.opencadc/cadc-adql

public Center(Function adqlFunction)
{
  super();
  setName("center");
  setParameters(adqlFunction.getParameters());
}

代码示例来源:origin: com.github.jsqlparser/jsqlparser

@Override
public void visit(Function function) {
  if (function.getParameters() != null) {
    function.getParameters().accept(this);
  }
  if (function.getKeep() != null) {
    function.getKeep().accept(this);
  }
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

@Override
public void visit(Function function) {
  // ROMAN (22 Sep 2015): longer list of supported functions?
  if (function.getName().toLowerCase().equals("regexp_like")) {
    for (Expression ex :function.getParameters().getExpressions()) 
      ex.accept(this);
  }
  else
    unsupported(function);
}

代码示例来源:origin: org.opencadc/cadc-adql

public Lat(Function adqlFunction)
{
  super();
  Function latFunction = new Function();
  latFunction.setName("lat");
  latFunction.setParameters(adqlFunction.getParameters());
  List<Expression> expressions = new ArrayList<Expression>();
  expressions.add(latFunction);
  ExpressionList expressionList = new ExpressionList();
  expressionList.setExpressions(expressions);
  setName("degrees");
  setParameters(expressionList);
}

代码示例来源:origin: org.opencadc/cadc-adql

public Longitude(Function adqlFunction)
{
  super();
  
  Function longFunction = new Function();
  longFunction.setName("long");
  longFunction.setParameters(adqlFunction.getParameters());
  List<Expression> expressions = new ArrayList<Expression>();
  expressions.add(longFunction);
  ExpressionList expressionList = new ExpressionList();
  expressionList.setExpressions(expressions);
  setName("degrees");
  setParameters(expressionList);
}

代码示例来源:origin: org.geotools/gt-arcsde

public void visit(Function function) {
  Function qfunction = new Function();
  qfunction.setAllColumns(function.isAllColumns());
  qfunction.setEscaped(function.isEscaped());
  qfunction.setName(function.getName());
  ExpressionList parameters = function.getParameters();
  ExpressionList qualifiedParams;
  qualifiedParams = (ExpressionList) ItemsListQualifier.qualify(session, tableAliases,
      parameters);
  qfunction.setParameters(qualifiedParams);
  this._qualifiedExpression = qfunction;
}

相关文章