Package org.drools.workbench.models.datamodel.imports

Examples of org.drools.workbench.models.datamodel.imports.Imports


        }
        model.setParentName(getExtendedRuleFromCategoryRules(jcrModule,jcrAssetItem,""));

        //Add import
        if ( packageHeaderInfo.getHeader() != null ) {
            final Imports imports = ImportsParser.parseImports( packageHeaderInfo.getHeader() );
            if ( imports != null ) {
                model.setImports( imports );
            }
        }
View Full Code Here


        Object o = xt.fromXML(xml);

        Scenario scenario = (Scenario) o;

        if (scenario.getImports() == null) {
            scenario.setImports(new Imports());
        }

        return scenario;
    }
View Full Code Here

        //De-serialize Package name
        final String packageName = PackageNameParser.parsePackageName( expandedDRLInfo.plainDrl );
        model.setPackageName( packageName );

        //De-serialize imports
        final Imports imports = ImportsParser.parseImports( expandedDRLInfo.plainDrl );
        for ( Import item : imports.getImports() ) {
            model.getImports().addImport( item );
        }

        boolean isJavaDialect = parseAttributes( model,
                                                 ruleDescr.getAttributes() );
View Full Code Here

        }
        model.setParentName(getExtendedRuleFromCategoryRules(jcrModule,jcrAssetItem,""));

        //Add import
        if ( packageHeaderInfo.getHeader() != null ) {
            final Imports imports = ImportsParser.parseImports( packageHeaderInfo.getHeader() );
            if ( imports != null ) {
                model.setImports( imports );
            }
        }
View Full Code Here

                                          final Path resource ) {
        if ( packageHeaderInfo.getHeader() == null ) {
            return drl;
        }

        final Imports imports = ImportsParser.parseImports( packageHeaderInfo.getHeader() );
        if ( imports == null ) {
            return drl;
        }
        StringBuilder sb = new StringBuilder();
        sb.append( imports.toString() );
        if ( imports.getImports().size() > 0 ) {
            sb.append( "\n" );
        }

        sb.append( drl );
        return sb.toString();
View Full Code Here

                                          final Path resource ) {
        if ( packageHeaderInfo.getHeader() == null ) {
            return xml;
        }

        final Imports imports = ImportsParser.parseImports( packageHeaderInfo.getHeader() );
        if ( imports == null ) {
            return xml;
        }

        DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();

        try {
            DocumentBuilder dombuilder = domfac.newDocumentBuilder();
            Document doc = dombuilder.parse( new ByteArrayInputStream( xml.getBytes() ) );

            if ( doc.getElementsByTagName( "imports" ).getLength() != 0 ) {
                return xml;
            }

            Element root = doc.getDocumentElement();
            Element importsElement = doc.createElement( "imports" );
            if(imports!=null && imports.getImports().size()==0){
                Element defaultImportElement = doc.createElement( "imports" );
                importsElement.appendChild(defaultImportElement);
            }

            for ( final Import i : imports.getImports() ) {
                Element importElement = doc.createElement( "import" );
                importElement.appendChild( doc.createTextNode( i.getType() ) );
                importsElement.appendChild( importElement );
            }
View Full Code Here

            //De-serialize Package name
            final String packageName = PackageNameParser.parsePackageName( content );
            factModels.setPackageName( packageName );

            //De-serialize imports
            final Imports imports = ImportsParser.parseImports( content );
            factModels.setImports( imports );

            return factModels;

        } catch ( final DroolsParserException e ) {
View Full Code Here

            //De-serialize Package name
            final String packageName = PackageNameParser.parsePackageName( content );
            factModels.setPackageName( packageName );

            //De-serialize imports
            final Imports imports = ImportsParser.parseImports( content );
            factModels.setImports( imports );

            return factModels;

        } catch ( final DroolsParserException e ) {
View Full Code Here

        //Check external imports are available. These are loaded when a DMO is requested, but it's better to report them early
        final org.uberfire.java.nio.file.Path nioExternalImportsPath = moduleDirectory.resolve( "project.imports" );
        if ( Files.exists( nioExternalImportsPath ) ) {
            final org.uberfire.backend.vfs.Path externalImportsPath = Paths.convert( nioExternalImportsPath );
            final ProjectImports projectImports = projectService.load( externalImportsPath );
            final Imports imports = projectImports.getImports();
            for ( final Import item : imports.getImports() ) {
                final String fullyQualifiedClassName = item.getType();
                try {
                    Class clazz = this.getClass().getClassLoader().loadClass( item.getType() );
                } catch ( ClassNotFoundException cnfe ) {
                    logger.error( cnfe.getMessage() );
View Full Code Here

        //De-serialize Package name
        final String packageName = PackageNameParser.parsePackageName( expandedDRLInfo.plainDrl );
        model.setPackageName( packageName );

        //De-serialize imports
        final Imports imports = ImportsParser.parseImports( expandedDRLInfo.plainDrl );
        for ( Import item : imports.getImports() ) {
            model.getImports().addImport( item );
        }

        boolean isJavaDialect = parseAttributes( model,
                                                 ruleDescr.getAttributes() );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.imports.Imports

Copyright © 2018 www.massapicom. 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.