コード例 #1
0
ファイル: GeneratorHelper.java プロジェクト: fahman/drools
 static ClassGenerator createInvokerClassGenerator(
     final InvokerStub stub, final WorkingMemory workingMemory) {
   String className = stub.getPackageName() + "." + stub.getGeneratedInvokerClassName();
   CompositeClassLoader classLoader = getCompositeClassLoader(stub, workingMemory);
   return createInvokerClassGenerator(
       className, stub, classLoader, getTypeResolver(stub, workingMemory, classLoader));
 }
コード例 #2
0
ファイル: GeneratorHelper.java プロジェクト: fahman/drools
 static TypeResolver getTypeResolver(
     final InvokerStub stub,
     final WorkingMemory workingMemory,
     final CompositeClassLoader classLoader) {
   org.drools.rule.Package pkg = workingMemory.getRuleBase().getPackage(stub.getPackageName());
   TypeResolver typeResolver = pkg == null ? null : pkg.getTypeResolver();
   if (typeResolver == null) {
     Set<String> imports = new HashSet<String>();
     for (String imp : stub.getPackageImports()) {
       imports.add(imp);
     }
     typeResolver = new ClassTypeResolver(imports, classLoader, stub.getPackageName());
   }
   return typeResolver;
 }