All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.tenmg.dsl.macro.ElseIf Maven / Gradle / Ivy

Go to download

动态脚本语言(DSL,Dynamic Script Language)解析框架。可广泛用于动态 SQL(即 DSQL)等场景的解析,DSQL 也是目前 DSL 最成功的应用领域,具体包括 Flink SQL(如 Clink)、Spark SQL(如 sparktool)和 JDBC(如 sqltool)。

There is a newer version: 1.4.4
Show newest version
package cn.tenmg.dsl.macro;

import java.util.Map;

import cn.tenmg.dsl.DSLContext;
import cn.tenmg.dsl.EvalEngine;

/**
 * else if判断宏
 * 
 * @author June [email protected]
 * 
 * @since 1.0.0
 */
public class ElseIf extends If {

	@Override
	boolean excute(EvalEngine evalEngine, DSLContext context, Map attributes, String logic,
			StringBuilder dslf) throws Exception {
		if (Boolean.TRUE.equals(attributes.get("if"))) {// if成立,则else if不成立
			dslf.setLength(0);
			return false;
		} else {// 否则,继续当做if处理
			return super.excute(evalEngine, context, attributes, logic, dslf);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy