org.jclarion.clarion.runtime.SQLBindProcedure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarion-runtime Show documentation
Show all versions of clarion-runtime Show documentation
JClarion runtime environment
/**
* Copyright 2010, by Andrew Barnham
*
* The contents of this file are subject to
* GNU Lesser General Public License (LGPL), v.3
* http://www.gnu.org/licenses/lgpl.txt
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
*/
package org.jclarion.clarion.runtime;
import org.jclarion.clarion.BindProcedure;
import org.jclarion.clarion.runtime.expr.CExpr;
import org.jclarion.clarion.runtime.expr.CExprType;
/**
* A bind procedure that has a SQL analogue
* @author barney
*/
public abstract class SQLBindProcedure extends BindProcedure
{
private String name;
private CExprType returnType;
private CExprType[] paramTypes;
public SQLBindProcedure(String name,CExprType returnType,CExprType... paramTypes)
{
this.name=name;
this.returnType=returnType;
this.paramTypes=paramTypes;
}
public boolean generateString(StringBuilder out,boolean strict,CExpr params[])
{
int pos = out.length();
if (params.length!=paramTypes.length) return false;
out.append(name);
out.append('(');
for (int scan=0;scan0) out.append(',');
if (!params[scan].generateString(out,strict)) {
out.setLength(pos);
return false;
}
}
out.append(')');
return true;
}
public CExprType getReturnType()
{
return returnType;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy