Package org.drools.core.spi

Examples of org.drools.core.spi.PatternExtractor


                                                                                                       store.getReader( Person.class,
                                                                                                                        "age",
                                                                                                                        getClass().getClassLoader() ),
                                                                                                       null )};
        final Declaration[] inner = new Declaration[]{new Declaration( "$cheese",
                                                                       new PatternExtractor( new ClassObjectType( Cheese.class ) ),
                                                                       null ), new Declaration( "$person",
                                                                                                new PatternExtractor( new ClassObjectType( Person.class ) ),
                                                                                                null )};
        final String[] globals = new String[]{"aGlobal", "anotherGlobal"};
        final List globalTypes = Arrays.asList( new String[]{"String", "String"} );

        final Map map = new HashMap();
View Full Code Here


        final ObjectType cheeseObjeectType = new ClassObjectType( Cheese.class );

        final Pattern pattern = new Pattern( 0,
                                             cheeseObjeectType );

        final PatternExtractor extractor = new PatternExtractor( cheeseObjeectType );

        final Declaration declaration = new Declaration( "cheese",
                                                         extractor,
                                                         pattern );
        final Map<String, Declaration> map = new HashMap<String, Declaration>();
View Full Code Here

        final ObjectType personObjeectType = new ClassObjectType( Person.class );

        final Pattern pattern = new Pattern( 0,
                                             personObjeectType );

        final PatternExtractor extractor = new PatternExtractor( personObjeectType );

        final Declaration declaration = new Declaration( "p",
                                                         extractor,
                                                         pattern );
        final Map<String, Declaration> map = new HashMap<String, Declaration>();
View Full Code Here

        out.writeObject( annotations );
    }
   
    public static InternalReadAccessor getReadAcessor(ObjectType objectType) {
        if ( !(objectType instanceof ClassObjectType) ) {
            return new PatternExtractor(objectType);
        }
        Class returnType = ((ClassObjectType) objectType).getClassType();
       
        if (Number.class.isAssignableFrom( returnType ) ||
                ( returnType == byte.class ||
                  returnType == short.class ||
                  returnType == int.class ||
                  returnType == long.class ||
                  returnType == float.class ||
                  returnType == double.class ) ) {           
            return new SelfNumberExtractor(objectType);           
         } else if Date.class.isAssignableFrom( returnType ) ) {
            return new SelfDateExtractor(objectType);
        } else {
            return new PatternExtractor(objectType);
        }       
    }
View Full Code Here

TOP

Related Classes of org.drools.core.spi.PatternExtractor

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.