
cfml.parsing.cfscript.script.CFCatchStatement Maven / Gradle / Ivy
package cfml.parsing.cfscript.script;
import cfml.parsing.cfscript.CFIdentifier;
public class CFCatchStatement extends CFCatchClause implements CFScriptStatement {
private CFIdentifier var;
private CFScriptStatement body;
public CFCatchStatement(String _type, CFIdentifier _var, CFScriptStatement _body) {
type = _type;
var = _var;
body = _body;
}
public CFCatchStatement(CFIdentifier _type, CFIdentifier _var, CFScriptStatement _body) {
type = _type.Decompile(0);
var = _var;
body = _body;
}
public CFIdentifier getVariable() {
return var;
}
public CFScriptStatement getCatchBody() {
return body;
}
@Override
public void checkIndirectAssignments(String[] scriptSource) {
body.checkIndirectAssignments(scriptSource);
}
@Override
public String Decompile(int indent) {
StringBuilder sb = new StringBuilder();
sb.append("catch( ");
sb.append(type);
sb.append(' ');
sb.append(var.Decompile(0));
sb.append(")\n");
sb.append(body.Decompile(0));
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy