stringWriter.write(getTargetLocation().toString()); stringWriter.write('\n'); String[] imports = ruleScript.getImports(); if (imports != null) { for (int i = 0; i < imports.length; i++) {
stringWriter.write(getTargetLocation().toString()); stringWriter.write('\n'); String[] imports = ruleScript.getImports(); if (imports != null) { for (int i = 0; i < imports.length; i++) {
/** * install helper class used to execute this rule. this may involve generating a compiled helper class * for the rule and, if compilation to bytecode is enabled, generating bytecode for a method of this class * used to execute the rule binding, condition and action expressions. If the rule employ sthe default helper * without enabling compilation to bytecode then no class need be generated. the installed helper class will * be the predefined class InterpretedHelper. * @throws CompileException if the rule cannot be compiled */ public void compile() throws CompileException { boolean doCompileToBytecode = doCompileToBytecode(); String[] imports = ruleScript.getImports(); Class<?> helperClass = getHelperClass(); if (helperClass == Helper.class && !doCompileToBytecode && imports.length == 0) { // we can use the builtin interpreted helper adapter for class Helper helperImplementationClass = InterpretedHelper.class; helperImplementationClassName = Type.internalName(helperImplementationClass, true); } else { // we need to generate a helper adapter class which either interprets or compiles helperImplementationClassName = Compiler.getHelperAdapterName(helperClass, doCompileToBytecode); helperImplementationClass = Compiler.getHelperAdapter(this, helperClass, helperImplementationClassName, doCompileToBytecode); } }
/** * install helper class used to execute this rule. this may involve generating a compiled helper class * for the rule and, if compilation to bytecode is enabled, generating bytecode for a method of this class * used to execute the rule binding, condition and action expressions. If the rule employ sthe default helper * without enabling compilation to bytecode then no class need be generated. the installed helper class will * be the predefined class InterpretedHelper. * @throws CompileException if the rule cannot be compiled */ public void compile() throws CompileException { boolean doCompileToBytecode = doCompileToBytecode(); String[] imports = ruleScript.getImports(); Class<?> helperClass = getHelperClass(); if (helperClass == Helper.class && !doCompileToBytecode && imports.length == 0) { // we can use the builtin interpreted helper adapter for class Helper helperImplementationClass = InterpretedHelper.class; helperImplementationClassName = Type.internalName(helperImplementationClass, true); } else { // we need to generate a helper adapter class which either interprets or compiles helperImplementationClassName = Compiler.getHelperAdapterName(helperClass, doCompileToBytecode); helperImplementationClass = Compiler.getHelperAdapter(this, helperClass, helperImplementationClassName, doCompileToBytecode); } }
String[] imports = ruleScript.getImports(); if (helperName != null || isCompileToBytecode() || imports.length > 0) {
String[] imports = ruleScript.getImports(); if (helperName != null || isCompileToBytecode() || imports.length > 0) {