Package org.drools.lang.dsl

Examples of org.drools.lang.dsl.DSLTokenizedMappingFile


    @Test
    public void testTestAnyEnum() throws Exception {
        SuggestionCompletionLoader suggestionCompletionLoader = new SuggestionCompletionLoader();
        ArrayList<DSLTokenizedMappingFile> dsls = new ArrayList<DSLTokenizedMappingFile>();

        DSLTokenizedMappingFile dslTokenizedMappingFile = new DSLTokenizedMappingFile();

        DSLMappingEntry dslMappingEntry = mock( DSLMappingEntry.class );
        when( dslMappingEntry.getSection() ).thenReturn( DSLMappingEntry.ANY );

        dslTokenizedMappingFile.getMapping().addEntry( dslMappingEntry );
        dsls.add( dslTokenizedMappingFile );

        SuggestionCompletionEngine suggestionEngine = suggestionCompletionLoader.getSuggestionEngine( "",
                                                                                                      Collections.<JarInputStream> emptyList(),
                                                                                                      dsls );
View Full Code Here


    }

    public void addDsl(Resource resource) throws IOException {
        this.resource = resource;

        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
        if ( !file.parseAndLoad( resource.getReader() ) ) {
            this.results.addAll( file.getErrors() );
        }
        if ( this.dslFiles == null ) {
            this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
        }
        this.dslFiles.add( file );
View Full Code Here

        return pkg;
    }

    public void addDsl( Resource resource ) throws IOException {
        this.resource = resource;
        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();

        Reader reader = null;
        try {
            reader = resource.getReader();
            if (!file.parseAndLoad( reader )) {
                this.results.addAll( file.getErrors() );
            }
            if (this.dslFiles == null) {
                this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
            }
            this.dslFiles.add( file );
View Full Code Here

       
       
        DefaultExpanderResolver resolver = new DefaultExpanderResolver(new StringReader(dsl));
       
       
        final DSLMappingFile file = new DSLTokenizedMappingFile();
        if ( file.parseAndLoad( new StringReader(dsl) ) ) {
            final Expander expander = new DefaultExpander();
            expander.addDSLMapping( file.getMapping() );
            resolver.addExpander("*", expander);
        } else {
            throw new RuntimeDroolsException( "Error parsing and loading DSL file." + file.getErrors() );
        }

        DrlParser parser = new DrlParser();
        String result = parser.getExpandedDRL( drl, resolver);
        assertEqualsIgnoreWhitespace( "rule 'foo' \n when \n Something() \n then \n another(); \nend", result );
View Full Code Here

    }

    public void addDsl( Resource resource ) throws IOException {
        this.resource = resource;

        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
        if ( !file.parseAndLoad( resource.getReader() ) ) {
            this.results.addAll( file.getErrors() );
        }
        if ( this.dslFiles == null ) {
            this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
        }
        this.dslFiles.add( file );
View Full Code Here

    }

    public void addDsl(Resource resource) throws IOException {
        this.resource = resource;

        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
        file.parseAndLoad( resource.getReader() );
        if ( this.dslFiles == null ) {
            this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
        }
        this.dslFiles.add( file );
View Full Code Here

    }

    public void addDsl(Resource resource) throws IOException {
        this.resource = resource;

        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
        if ( !file.parseAndLoad( resource.getReader() ) ) {
            this.results.addAll( file.getErrors() );
        }
        if ( this.dslFiles == null ) {
            this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
        }
        this.dslFiles.add( file );
View Full Code Here

        this.url = null;
    }

    public void addDsl(Reader dsl) {
        try {
            DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
            file.parseAndLoad( dsl );
            if ( this.dslFiles == null ) {
                this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
            }
            this.dslFiles.add( file );
        } catch ( Exception e ) {
View Full Code Here

    }

    public void addDsl(Resource resource) throws IOException {
        this.resource = resource;

        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
        file.parseAndLoad( resource.getReader() );
        if ( this.dslFiles == null ) {
            this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
        }
        this.dslFiles.add( file );
View Full Code Here

    }

    public void addDsl(Resource resource) throws IOException {
        this.resource = resource;

        DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
        if ( !file.parseAndLoad( resource.getReader() ) ) {
            this.results.addAll( file.getErrors() );
        }
        if ( this.dslFiles == null ) {
            this.dslFiles = new ArrayList<DSLTokenizedMappingFile>();
        }
        this.dslFiles.add( file );
View Full Code Here

TOP

Related Classes of org.drools.lang.dsl.DSLTokenizedMappingFile

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.