Examples of RuleSetReader


Examples of com.buschmais.jqassistant.core.analysis.api.RuleSetReader

            rulePluginRepository = new RulePluginRepositoryImpl(pluginConfigurationReader);
        } catch (PluginRepositoryException e) {
            throw new SonarException("Cannot read rules.", e);
        }
        List<Source> ruleSources = rulePluginRepository.getRuleSources();
        RuleSetReader ruleSetReader = new RuleSetReaderImpl();
        RuleSet ruleSet = ruleSetReader.read(ruleSources);
        for (Concept concept : ruleSet.getConcepts().values()) {
            rules.add(createRule(concept, RuleType.Concept));
        }
        for (Constraint constraint : ruleSet.getConstraints().values()) {
            rules.add(createRule(constraint, RuleType.Constraint));
View Full Code Here

Examples of org.drools.io.RuleSetReader

        // Build the RuleSets.
        verbose( "Building RuleBase with " + numberOfRules + " rules..." );
        RuleBaseBuilder builder = new RuleBaseBuilder( );
        builder.addRuleSet( ruleSet );
        builder.addRuleSet( new RuleSetReader( ).read( PrimeFactors.class.getResource( DRL_FILE ) ) );
        RuleBase ruleBase = builder.build( );
        verbose( "Built RuleBase with " + numberOfRules + " rules"
                 + stopwatch( 0 ) );

        // Determine random set of Facts to assert
View Full Code Here

Examples of org.drools.io.RuleSetReader

    {
        // Prepare the DOM source
        Source source = new DOMSource( ruleExecutionSetElement );

        // Create a reader to handle the SAX events
        RuleSetReader reader;
        try
        {
            reader =
                new RuleSetReader( DefaultSemanticsRepository.getInstance( ) );
        }
        catch ( SemanticsReaderException e )
        {
            throw new RuleExecutionSetCreateException(
                "Couldn't get an instance of the DefaultSemanticsRepository: "
                + e );
        }
        catch ( IOException e )
        {
            throw new RuleExecutionSetCreateException(
                "Couldn't get an instance of the DefaultSemanticsRepository: "
                + e );
        }

        try
        {
            // Prepare the result
            SAXResult result = new SAXResult( reader );

            // Create a transformer
            Transformer xformer =
                TransformerFactory.newInstance( ).newTransformer( );

            // Traverse the DOM tree
            xformer.transform( source, result );
        }
        catch ( TransformerException e )
        {
            throw new RuleExecutionSetCreateException(
                "could not create RuleExecutionSet: " + e );
        }

        RuleSet ruleSet = reader.getRuleSet( );
        LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider =
            new LocalRuleExecutionSetProviderImpl( );
        return localRuleExecutionSetProvider.createRuleExecutionSet(
            ruleSet, properties );
    }
View Full Code Here

Examples of org.drools.io.RuleSetReader

        try
        {
            resourceAsStream =
                RuleEngineTestBase.class.getResourceAsStream( bindUri );
            Reader reader = new InputStreamReader( resourceAsStream );
            RuleSetReader ruleSetReader = new RuleSetReader( );
            this.ruleSet = ruleSetReader.read( reader );
        }
        catch ( IOException e )
        {
            throw new ExceptionInInitializerError(
                "setUp() could not init the " +
View Full Code Here

Examples of org.drools.io.RuleSetReader

            InputStream ruleExecutionSetStream, Map properties )
        throws RuleExecutionSetCreateException
    {
        try
        {
            RuleSetReader setReader = new RuleSetReader( );
            RuleSet ruleSet = setReader.read( ruleExecutionSetStream );
            return this.createRuleExecutionSet( ruleSet, properties );
        }
        catch ( SAXException e )
        {
            throw new RuleExecutionSetCreateException(
View Full Code Here

Examples of org.drools.io.RuleSetReader

            Reader ruleExecutionSetReader, Map properties )
        throws RuleExecutionSetCreateException
    {
        try
        {
            RuleSetReader setReader = new RuleSetReader( );
            RuleSet ruleSet = setReader.read( ruleExecutionSetReader );
            return this.createRuleExecutionSet( ruleSet, properties );
        }
        catch ( SAXException e )
        {
            throw new RuleExecutionSetCreateException(
View Full Code Here

Examples of org.drools.io.RuleSetReader

        try
        {
            inputStream =
                RuleEngineTestBase.class.getResourceAsStream( bindUri );
            Reader in = new InputStreamReader( inputStream );
            RuleSet ruleSet = new RuleSetReader( ).read( in );
            RuleExecutionSet ruleExecutionSet =
                ruleSetProvider.createRuleExecutionSet( ruleSet, null );
            assertEquals( "rule set name", "Sisters Rules",
                          ruleExecutionSet.getName( ) );
            assertEquals(
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.