Examples of Extractor


Examples of org.drools.spi.Extractor

    public void testDeclaration()
    {
        ObjectType stringObjectType = new ClassObjectType( String.class );

        /* Determines how the bound value is extracted from the column */
        Extractor typeOfCheeseExtractor = new Extractor()
        {
            public Object getValue(Object object)
            {
                return ((Cheese) object).getType();
            }
View Full Code Here

Examples of org.drools.spi.Extractor

    public void testGetFieldValue()
    {
        ObjectType stringObjectType = new ClassObjectType( String.class );

        /* Determines how the bound value is extracted from the column */
        Extractor typeOfCheeseExtractor = new Extractor()
        {
            public Object getValue(Object object)
            {
                return ((Cheese) object).getType();
            }
View Full Code Here

Examples of org.drools.spi.Extractor

        InstrumentedWorkingMemoryImpl workingMemory = new InstrumentedWorkingMemoryImpl( );

        ObjectType stringObjectType = new ClassObjectType( String.class );

        /* Determines how the bound value is extracted from the column */
        Extractor typeOfCheeseExtractor = new Extractor( ) {
            public Object getValue(Object object)
            {
                return ((Cheese) object).getType( );
            }
        };
View Full Code Here

Examples of org.drools.spi.Extractor

        InstrumentedWorkingMemoryImpl workingMemory = new InstrumentedWorkingMemoryImpl( );

        ObjectType stringObjectType = new ClassObjectType( String.class );

        /* Determines how the bound value is extracted from the column */
        Extractor typeOfCheeseExtractor = new Extractor( ) {
            public Object getValue(Object object)
            {
                return ((Cheese) object).getType( );
            }
        };
View Full Code Here

Examples of org.drools.spi.Extractor

        InstrumentedWorkingMemoryImpl workingMemory = new InstrumentedWorkingMemoryImpl( );

        ObjectType integerObjectType = new ClassObjectType( Integer.class );

        /* Determines how the bound value is extracted from the column */
        Extractor priceOfCheeseExtractor = new Extractor( ) {
            public Object getValue(Object object)
            {
                return new Integer( ((Cheese) object).getPrice( ) );
            }
        };
View Full Code Here

Examples of org.drools.spi.Extractor

        InstrumentedWorkingMemoryImpl workingMemory = new InstrumentedWorkingMemoryImpl( );

        ObjectType integerObjectType = new ClassObjectType( Integer.class );

        /* Determines how the bound value is extracted from the column */
        Extractor priceOfCheeseExtractor = new Extractor( ) {
            public Object getValue(Object object)
            {
                return new Integer( ((Cheese) object).getPrice( ) );
            }
        };
View Full Code Here

Examples of org.drools.spi.Extractor

        this.workingMemory = new WorkingMemoryImpl( new RuleBaseImpl( new Rete() ) );

        ObjectType stringObjectType = new ClassObjectType( String.class );

        /* just return the object */
        Extractor stringExtractor = new Extractor() {
            public Object getValue(Object object)
            {
                return object;
            }
        };
View Full Code Here

Examples of org.drools.spi.Extractor

    public void testJoinNodeWithConstraint() throws Exception
    {
        ObjectType stringObjectType = new ClassObjectType( String.class );

        /* just return the object */
        Extractor stringExtractor = new Extractor() {
            public Object getValue(Object object)
            {
                return object;
            }
        };
View Full Code Here

Examples of org.drools.spi.Extractor

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

Examples of org.drools.spi.Extractor

     * @param data The data to try out : Array of {arg1, operator, arg2}
     * @param valueType The Evaluator.**_TYPE to test
     */
    private void runEvaluatorTest(final Object[][] data,
                                  final ValueType valueType) {
        final Extractor extractor = new MockExtractor();
        for ( int i = 0; i < data.length; i++ ) {
            final Object[] row = data[i];
            final Evaluator evaluator = valueType.getEvaluator( Operator.determineOperator( (String) row[1] ) );
            checkEvaluatorMethodWithFieldValue( valueType,
                                                extractor,
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.