Package org.drools.spi

Examples of org.drools.spi.Extractor


        final Pattern col = new Pattern( 0,
                                       type,
                                       "foo" );
        final Declaration dec = col.getDeclaration();
        final Extractor ext = dec.getExtractor();
        assertEquals( Fact.class,
                      ext.getExtractToClass() );

        final Fact stilton = cheese.createFact( 10 );
        stilton.setFieldValue( "name",
                               "stilton" );
        stilton.setFieldValue( "price",
View Full Code Here


    public void testIsNullValue() {
        try {
            Assert.assertFalse( this.extractor.isNullValue( null,
                                                            this.person[0] ) );

            Extractor nullExtractor = ClassFieldExtractorCache.getInstance().getExtractor( Person.class,
                                                                                           "addresses['business'].phone",
                                                                                           getClass().getClassLoader() );
            Assert.assertTrue( nullExtractor.isNullValue( null,
                                                          this.person[0] ) );
        } catch ( final Exception e ) {
            fail( "Should not throw an exception" );
        }
    }
View Full Code Here

    public void testIsNullValue() {
        try {
            Assert.assertFalse( this.extractor.isNullValue( null,
                                                            this.bean ) );

            Extractor nullExtractor = ClassFieldExtractorCache.getInstance().getExtractor( TestBean.class,
                                                                                           "nullAttr",
                                                                                           getClass().getClassLoader() );
            Assert.assertTrue( nullExtractor.isNullValue( null,
                                                          this.bean ) );
        } catch ( final Exception e ) {
            fail( "Should not throw an exception" );
        }
    }
View Full Code Here

       
        Set inputs = compiler.getParserContextState().getInputs().keySet();
        for( Iterator it = inputs.iterator(); it.hasNext(); ) {
            String basefield = (String) it.next();
                       
            Extractor extr = ClassFieldExtractorCache.getExtractorclazz, basefield, classLoader );
            this.extractors.put( basefield, extr );
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.spi.Extractor

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.