}
}
private void generate_rules() {
for(JTabbedPane rulePane : this.editor.getRules()) {
RulePanel rule = (RulePanel) rulePane;
String ruleClassName = this.capitalizeWord(rule.toString().replaceAll(" ", "") + "Rule");
String ruleClassFileName = ruleClassName + ".java";
ImplementationPanel rImplementationPanel = rule.getImplementationPanel();
// -- validating rule - begin --
Triple<Boolean, HashMap<String, VariableContainer>, HashMap<String, VariableContainer>> resultTriple = this.validateRule(ruleClassName, rule);
if(!resultTriple.getFirst()) {
continue;
}
// -- validating rule - end --
System.out.println(":: generating " + ruleClassFileName + "...");
this.variableList_left = resultTriple.getSecond();
this.globalCode = new StringBuffer(this.formatCode(rImplementationPanel.getAdditionalGlobalJavaCode(), " ") + "\n");
String additionalImportDeclarations = rImplementationPanel.getAdditionalImportDeclarations()+"\n";
String startNodeClass = this.generate_check_method(rule);
this.generate_replace_method(rule, resultTriple.getThird());
String javaCode = String.format(this.getTemplate("ruleClass"), this.packageName, additionalImportDeclarations, ruleClassName, this.globalCode.toString(), ruleClassName, startNodeClass, rule.toString(), this.checkMethodCode.toString(), this.replaceMethodCode.toString());
File.writeFile(this.targetDirectory + ruleClassFileName, javaCode);
}
}