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

com.scudata.ide.spl.etl.element.FXlsWrite Maven / Gradle / Ivy

Go to download

SPL(Structured Process Language) A programming language specially for structured data computing.

There is a newer version: 20240823
Show newest version
package com.scudata.ide.spl.etl.element;

import java.util.StringTokenizer;

import com.scudata.common.StringUtils;
import com.scudata.ide.spl.etl.EtlConsts;
import com.scudata.ide.spl.etl.ObjectElement;
import com.scudata.ide.spl.etl.ParamInfo;
import com.scudata.ide.spl.etl.ParamInfoList;

/**
 * ?????????༭ f.xlswrite()
 * ??????ǰ׺F??ʾ?ļ?????
 * 
 * @author Joancy
 *
 */
public class FXlsWrite extends ObjectElement {
	public String xls;
	public String password;

	/**
	 * ??ȡ???ڽ???༭?IJ?????Ϣ?б?
	 */
	public ParamInfoList getParamInfoList() {
		ParamInfoList paramInfos = new ParamInfoList();
		ParamInfo.setCurrent(FXlsWrite.class, this);

		paramInfos.add(new ParamInfo("xls",EtlConsts.INPUT_CELLXLS,true));
		paramInfos.add(new ParamInfo("password"));
		
		return paramInfos;
	}

	/**
	 * ??ȡ??????
	 * ???͵ij???????Ϊ
	 * EtlConsts.TYPE_XXX
	 * @return EtlConsts.TYPE_FILE
	 */
	public byte getParentType() {
		return EtlConsts.TYPE_FILE;
	}

	/**
	 * ??ȡ?ú????ķ???????
	 * @return EtlConsts.TYPE_EMPTY
	 */
	public byte getReturnType() {
		return EtlConsts.TYPE_EMPTY;
	}

	/**
	 * ??ȡ????????SPL????ʽ?ĺ?????
	 */
	public String getFuncName(){
		return "xlswrite";
	}
	
	/**
	 * ??ȡ????????SPL????ʽ??ѡ?
	 */
	public String optionString(){
		return null;
	}
	
	/**
	 * ??ȡ????????SPL????ʽ?ĺ?????
	 * ??setFuncBody???溯????Ȼ?????ʽ?ĸ?ֵҲ???ǻ????
	 */
	public String getFuncBody() {
		StringBuffer sb = new StringBuffer();
		sb.append(getExpressionExp(xls));
		if(StringUtils.isValidString(password)){
			sb.append(",");
			sb.append( getParamExp(password) );
		}
		return sb.toString();
	}

	/**
	 * ???ú?????
	 * @param funcBody ??????
	 */
	public boolean setFuncBody(String funcBody) {
		StringTokenizer st = new StringTokenizer(funcBody,",");
		xls = getExpression( st.nextToken() );
		if( st.hasMoreTokens()){
			password = getParam(st.nextToken());
		}
		return true;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy