Package org.drools.spi

Examples of org.drools.spi.ObjectType


public class DeclarationTest extends TestCase
{

    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)
View Full Code Here


    }

    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)
View Full Code Here

     */
    public void testBoundConstraint()
    {
        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)
            {
View Full Code Here

     */
    public void testDoubleBoundConstraint()
    {
        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)
            {
View Full Code Here

     */
    public void testBooleanExpressionConstraint()
    {
        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)
            {
View Full Code Here

     */
    public void testReturnValueConstraint()
    {
        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)
            {
View Full Code Here

        this.context = new PropagationContextImpl( PropagationContext.ASSERTION,
                                               null,
                                               null );
        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)
            {
View Full Code Here

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

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

                    null,
                    "ObjectType not correctly defined"));
            return null;
        }

        ObjectType objectType = null;

        final FactTemplate factTemplate = context.getPkg().getFactTemplate( patternDescr.getObjectType() );

        if ( factTemplate != null ) {
            objectType = new FactTemplateObjectType( factTemplate );
View Full Code Here

            pattern.setListenedProperties(listenedProperties);
        }
    }

    protected List<String> getSettableProperties(RuleBuildContext context, PatternDescr patternDescr, Pattern pattern) {
        ObjectType patternType = pattern.getObjectType();
        if (!(patternType instanceof ClassObjectType)) return null;
        Class<?> patternClass = ((ClassObjectType)patternType).getClassType();
        TypeDeclaration typeDeclaration = context.getPackageBuilder().getTypeDeclaration(patternClass);
        if (!typeDeclaration.isPropertyReactive()) {
            context.addError( new DescrBuildError( context.getParentDescr(),
View Full Code Here

TOP

Related Classes of org.drools.spi.ObjectType

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.