Package org.kie.workbench.common.services.refactoring.model.index.terms.valueterms

Examples of org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueTypeIndexTerm


        {
            final IndexSearcher searcher = ( (LuceneIndex) index ).nrtSearcher();
            final TopScoreDocCollector collector = TopScoreDocCollector.create( 10,
                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.dsltext.backend.server.indexing.classes.Applicant" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;
            assertEquals( 2,
                          hits.length );

            final List<KObject> results = new ArrayList<KObject>();
            for ( int i = 0; i < hits.length; i++ ) {
                results.add( KObjectUtil.toKObject( searcher.doc( hits[ i ].doc ) ) );
            }
            assertContains( results,
                            path1 );
            assertContains( results,
                            path2 );

            ( (LuceneIndex) index ).nrtRelease( searcher );
        }

        {
            final IndexSearcher searcher = ( (LuceneIndex) index ).nrtSearcher();
            final TopScoreDocCollector collector = TopScoreDocCollector.create( 10,
                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.dsltext.backend.server.indexing.classes.Mortgage" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;
            assertEquals( 1,
View Full Code Here


            }
        }
    }

    private void visit( final Pattern52 o ) {
        builder.addGenerator( new Type( new ValueTypeIndexTerm( getFullyQualifiedClassName( o.getFactType() ) ) ) );
        for ( ConditionCol52 c : o.getChildColumns() ) {
            visit( c );
        }
    }
View Full Code Here

    private void visit( final ConditionCol52 o ) {
        final Pattern52 p = model.getPattern( o );
        final String fullyQualifiedClassName = getFullyQualifiedClassName( p.getFactType() );
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( o.getFactField() ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( o.getFieldType() ) ),
                                             new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
    }
View Full Code Here

        results.addAll( visitor.visit() );
    }

    private void visit( final ActionInsertFactCol52 o ) {
        final String fullyQualifiedClassName = getFullyQualifiedClassName( o.getFactType() );
        builder.addGenerator( new Type( new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( o.getFactField() ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( o.getType() ) ),
                                             new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
    }
View Full Code Here

    private void visit( final ActionSetFieldCol52 o ) {
        final Pattern52 p = model.getConditionPattern( o.getBoundName() );
        final String fullyQualifiedClassName = getFullyQualifiedClassName( p.getFactType() );
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( o.getFactField() ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( o.getType() ) ),
                                             new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
    }
View Full Code Here

                                                                                                           new ValueRuleAttributeValueIndexTerm( attr.getValue() ) ) );
    }

    //ActionInsertFact, ActionSetField, ActionUpdateField
    private void visitActionFieldList( final ActionInsertFact afl ) {
        builder.addGenerator( new Type( new ValueTypeIndexTerm( getFullyQualifiedClassName( afl.getFactType() ) ) ) );
    }
View Full Code Here

                   afv );
        }
    }

    private void visitCompositeFactPattern( final CompositeFactPattern pattern ) {
        builder.addGenerator( new Type( new ValueTypeIndexTerm( getFullyQualifiedClassName( pattern.getType() ) ) ) );
        if ( pattern.getPatterns() != null ) {
            for ( IFactPattern fp : pattern.getPatterns() ) {
                visit( fp );
            }
        }
View Full Code Here

    private void visitDSLSentence( final DSLSentence sentence ) {
        //TODO - Index DSLSentences
    }

    private void visitFactPattern( final FactPattern pattern ) {
        builder.addGenerator( new Type( new ValueTypeIndexTerm( getFullyQualifiedClassName( pattern.getFactType() ) ) ) );
        for ( FieldConstraint fc : pattern.getFieldConstraints() ) {
            visit( fc );
        }
    }
View Full Code Here

        return null;
    }

    private void visitSingleFieldConstraint( final SingleFieldConstraint sfc ) {
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( sfc.getFieldName() ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( sfc.getFieldType() ) ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( sfc.getFactType() ) ) ) );
        if ( sfc.getConnectives() != null ) {
            for ( int i = 0; i < sfc.getConnectives().length; i++ ) {
                visit( sfc.getConnectives()[ i ] );
            }
        }
View Full Code Here

        }
    }

    private void visitConnectiveConstraint( final ConnectiveConstraint cc ) {
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( cc.getFieldName() ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( cc.getFieldType() ) ),
                                             new ValueTypeIndexTerm( getFullyQualifiedClassName( cc.getFactType() ) ) ) );
    }
View Full Code Here

TOP

Related Classes of org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueTypeIndexTerm

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.