本文整理汇总了Java中net.sf.jsqlparser.expression.CaseExpression类的典型用法代码示例。如果您正苦于以下问题:Java CaseExpression类的具体用法?Java CaseExpression怎么用?Java CaseExpression使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CaseExpression类属于net.sf.jsqlparser.expression包,在下文中一共展示了CaseExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression caseExpression) {
buffer.append("CASE ");
Expression switchExp = caseExpression.getSwitchExpression();
if (switchExp != null) {
switchExp.accept(this);
buffer.append(" ");
}
for (Expression exp : caseExpression.getWhenClauses()) {
exp.accept(this);
}
Expression elseExp = caseExpression.getElseExpression();
if (elseExp != null) {
buffer.append("ELSE ");
elseExp.accept(this);
buffer.append(" ");
}
buffer.append("END");
}
示例2: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
public void visit(CaseExpression caseExpression) {
buffer.append(caseExpression.getCommentCase() != null ? caseExpression.getCommentElse() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Case ");
Expression switchExp = caseExpression.getSwitchExpression();
if (switchExp != null) {
switchExp.accept(this);
}
List clauses = caseExpression.getWhenClauses();
for (Iterator iter = clauses.iterator(); iter.hasNext();) {
Expression exp = (Expression) iter.next();
exp.accept(this);
}
Expression elseExp = caseExpression.getElseExpression();
if (elseExp != null) {
elseExp.accept(this);
}
buffer.append(caseExpression.getCommentEnd() != null ? " " + caseExpression.getCommentEnd() + ExpressionDeParser.LINE_SEPARATOR : "").append(" End");
}
示例3: create
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
public static CompiledCaseExpression create(String validatedTableAlias, CaseExpression caseExpression) {
Expression switchExpression = caseExpression.getSwitchExpression();
if (switchExpression != null) {
throw new StatementExecutionException("unhandled expression CASE SWITCH, type " + caseExpression.getClass() + ": " + caseExpression);
}
List<Entry<CompiledSQLExpression, CompiledSQLExpression>> whens = null;
if (caseExpression.getWhenClauses() != null) {
whens = new ArrayList<>();
for (Expression when : caseExpression.getWhenClauses()) {
WhenClause whenClause = (WhenClause) when;
CompiledSQLExpression whenCondition = compileExpression(validatedTableAlias, whenClause.getWhenExpression());
if (whenCondition == null) {
return null;
}
CompiledSQLExpression thenExpr = compileExpression(validatedTableAlias, whenClause.getThenExpression());
whens.add(new AbstractMap.SimpleImmutableEntry<>(whenCondition, thenExpr));
}
}
Expression elseExp = caseExpression.getElseExpression();
if (elseExp != null) {
CompiledSQLExpression elseExpression = compileExpression(validatedTableAlias, elseExp);
if (elseExpression == null) {
return null;
}
return new CompiledCaseExpression(whens, elseExpression);
} else {
return new CompiledCaseExpression(whens, null);
}
}
示例4: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression caseExpression) {
if (caseExpression.getSwitchExpression() != null) {
caseExpression.getSwitchExpression().accept(this);
}
if (caseExpression.getWhenClauses() != null) {
caseExpression.getWhenClauses().forEach(e -> e.accept(this));
}
if (caseExpression.getElseExpression() != null) {
caseExpression.getElseExpression().accept(this);
}
}
示例5: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression ce) {
if (ce.getElseExpression() != null) {
ce.getElseExpression().accept(this);
}
if (ce.getSwitchExpression() != null) {
ce.getSwitchExpression().accept(this);
}
ce.getWhenClauses().forEach(e -> e.accept(this));
}
示例6: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression ce) {
for (Iterator it = ce.getWhenClauses().iterator(); it.hasNext();) {
((WhenClause) it.next()).accept(this);
}
ce.getSwitchExpression().accept(this);
ce.getElseExpression().accept(this);
}
示例7: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression expr)
{
invalid = true;
super.visit(expr);
}
示例8: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression caseExpression) {
}
示例9: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression caseExpression) {
// TODO Auto-generated method stub
}
示例10: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression arg0) {
log.debug("sql expression = " + arg0.toString());
value = arg0.toString();
}
示例11: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
public void visit(CaseExpression caseExpression) {
}
示例12: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression arg0) {
isSimple = false;
}
示例13: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression caseExpression) {
// TODO Auto-generated method stub
}
示例14: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
public void visit(CaseExpression caseExpression) {
// TODO Auto-generated method stub
}
示例15: visit
import net.sf.jsqlparser.expression.CaseExpression; //导入依赖的package包/类
@Override
public void visit(CaseExpression caseExpression)
{
throw new UnsupportedSqlExpressionException("CASE"); //$NON-NLS-1$
}