Examples of addImport()


Examples of org.dmd.util.codegen.ImportManager.addImport()

       
        String nameBaseImport = ertd.getExtendedReferenceClass().getIsNamedBy().getType().getDefinedIn().getSchemaPackage() + ".generated.types.DmcType";
        String nameImport = ertd.getExtendedReferenceClass().getIsNamedBy().getType().getName().getNameString() + "SV";
        String staticNameType = ertd.getExtendedReferenceClass().getIsNamedBy().getType().getName().getNameString() + "STATIC";

        imports.addImport(nameBaseImport + nameImport, "Name type");
        imports.addImport(ertd.getExtendedReferenceClass().getIsNamedBy().getType().getPrimitiveType(), "Name type");
       
        imports.addImport(nameBaseImport + staticNameType, "Static type for name");
       
        imports.addImport(ertd.getExtendedReferenceClass().getDmoImport(), "Object based constructor");
View Full Code Here

Examples of org.drools.base.ClassTypeResolver.addImport()

                false));
        sc.getFixtures().addAll(facts);
        sc.getGlobals().addAll(globals);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("java.util.List");

        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());
View Full Code Here

Examples of org.drools.base.TypeResolver.addImport()

                false));
        sc.getFixtures().addAll(facts);
        sc.getGlobals().addAll(globals);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("java.util.List");

        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());
View Full Code Here

Examples of org.drools.compiler.compiler.PackageRegistry.addImport()

        this.pkgRegistryMap.put(pkg.getName(),
                                pkgRegistry);

        // add imports to pkg registry
        for (final ImportDeclaration implDecl : pkg.getImports().values()) {
            pkgRegistry.addImport(new ImportDescr(implDecl.getTarget()));
        }

        processBuilder = createProcessBuilder();
        typeBuilder = new TypeDeclarationBuilder(this);
    }
View Full Code Here

Examples of org.drools.compiler.lang.descr.PackageDescr.addImport()

                    } else if (typeDescr instanceof EnumDeclarationDescr) {
                        altDescr.addEnumDeclaration((EnumDeclarationDescr) typeDescr);
                    }

                    for (ImportDescr imp : packageDescr.getImports()) {
                        altDescr.addImport(imp);
                    }
                    if (!kbuilder.getPackageRegistry().containsKey(altDescr.getNamespace())) {
                        kbuilder.createPackageRegistry( altDescr );
                    }
                }
View Full Code Here

Examples of org.drools.core.base.ClassTypeResolver.addImport()

    @Test
    public void testFactAssignmentField() throws Exception {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        TypeResolver typeResolver = new ClassTypeResolver(new HashSet<String>(),classLoader );
        typeResolver.addImport("org.drools.workbench.models.testscenarios.backend.Cheese");

        Mouse mouse = new Mouse();

        FactAssignmentField factAssignmentField = new FactAssignmentField("cheese", "Cheese");
View Full Code Here

Examples of org.drools.core.base.TypeResolver.addImport()

    @Test
    public void testFactAssignmentField() throws Exception {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        TypeResolver typeResolver = new ClassTypeResolver(new HashSet<String>(),classLoader );
        typeResolver.addImport("org.drools.workbench.models.testscenarios.backend.Cheese");

        Mouse mouse = new Mouse();

        FactAssignmentField factAssignmentField = new FactAssignmentField("cheese", "Cheese");
View Full Code Here

Examples of org.drools.core.definitions.InternalKnowledgePackage.addImport()

   
    private void setupTest(String consequence, Map<String, Object> namedConsequences) {
        builder = new MVELConsequenceBuilder();

        InternalKnowledgePackage pkg = new KnowledgePackageImpl( "org.drools.compiler.test" );
        pkg.addImport( new ImportDeclaration( Cheese.class.getCanonicalName() ) );

        KnowledgeBuilderConfigurationImpl conf = new KnowledgeBuilderConfigurationImpl();
        KnowledgeBuilderImpl pkgBuilder = new KnowledgeBuilderImpl( pkg, conf );

        ruleDescr = new RuleDescr( "test consequence builder" );
View Full Code Here

Examples of org.drools.core.definitions.impl.KnowledgePackageImpl.addImport()

   
    private void setupTest(String consequence, Map<String, Object> namedConsequences) {
        builder = new MVELConsequenceBuilder();

        InternalKnowledgePackage pkg = new KnowledgePackageImpl( "org.drools.compiler.test" );
        pkg.addImport( new ImportDeclaration( Cheese.class.getCanonicalName() ) );

        KnowledgeBuilderConfigurationImpl conf = new KnowledgeBuilderConfigurationImpl();
        KnowledgeBuilderImpl pkgBuilder = new KnowledgeBuilderImpl( pkg, conf );

        ruleDescr = new RuleDescr( "test consequence builder" );
View Full Code Here

Examples of org.drools.core.rule.MVELDialectRuntimeData.addImport()

                        data.addPackageImport( imp.substring( 0,
                                                imp.lastIndexOf( '.' ) ) );
                    } else {
                        //classImports.add( imp );
                        cls = data.getRootClassLoader().loadClass( imp ) ;
                        data.addImport( cls.getSimpleName(),  cls);
                    }
                } 
            } catch (Exception e) {
                throw new RuntimeException("Unable to load class",e );
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.