Package org.drools.lang.descr

Examples of org.drools.lang.descr.PatternDescr


                       final ExtensibleXmlParser parser ) throws SAXException {
        final Element element = parser.endElementBuilder();

        final BindingDescr fieldBindingDescr = (BindingDescr) parser.getCurrent();

        final PatternDescr patternDescr = (PatternDescr) parser.getParent();

        patternDescr.addConstraint( fieldBindingDescr );

        return fieldBindingDescr;
    }
View Full Code Here


            c.buildExpression( sb );
                 
            ExprConstraintDescr expr = new ExprConstraintDescr( );
            expr.setExpression( sb.toString() );
             
            final PatternDescr patternDescr = (PatternDescr)op; 
            patternDescr.addConstraint( expr );   
        } else {       
            ConnectiveDescr p = (ConnectiveDescr)op;
            p.add( c );
        }
        return c;
View Full Code Here

        final AccumulateDescr accumulateDescr = (AccumulateDescr) parser.getCurrent();

        final Object parent = parser.getParent();

        if ( parent.getClass().getName().equals( FromDescr.class.getName() ) ) {
            final PatternDescr result = (PatternDescr) parser.getParent( 1 );
            result.setSource( accumulateDescr );

        } else if ( parent instanceof ConditionalElementDescr ) {
            final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
            parentDescr.addDescr( accumulateDescr );
        }
View Full Code Here

        final Element element = parser.endElementBuilder();
        final String expression =((org.w3c.dom.Text)element.getChildNodes().item( 0 )).getWholeText();
        emptyContentCheck( localName, expression, parser );
       
       
        PatternDescr p = (PatternDescr) parser.getParent();
       
        ExprConstraintDescr descr = new ExprConstraintDescr( expression );
       
        p.getConstraint().addDescr( descr );

        return descr;  
    }
View Full Code Here

        final CollectDescr collectDescr = (CollectDescr) parser.getCurrent();

        final Object parent = parser.getParent();

        if ( parent.getClass().getName().equals( FromDescr.class.getName() ) ) {
            final PatternDescr resultPattern = (PatternDescr) parser.getParent( 1 );
            resultPattern.setSource( collectDescr );
        } else if ( parent instanceof ConditionalElementDescr ) {
            final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
            parentDescr.addDescr( collectDescr );
        }
View Full Code Here

        final FromDescr fromDescr = (FromDescr) parser.getCurrent();

        Object parent = parser.getParent();

        final PatternDescr patternDescr = (PatternDescr) parent;

        final ConditionalElementDescr parentDescr = (ConditionalElementDescrparser.getParent( 1 );
               
        if ( element.getElementsByTagName( "expression" ).getLength() > 0 ) {
            patternDescr.setSource( fromDescr );
        }

        return fromDescr;
    }
View Full Code Here

            c.buildExpression( sb );

            ExprConstraintDescr expr = new ExprConstraintDescr();
            expr.setExpression( sb.toString() );

            final PatternDescr patternDescr = (PatternDescr) parser.getParent();
            patternDescr.addConstraint( expr );

        } else if ( p instanceof ConnectiveDescr ) {
            ((ConnectiveDescr) p).add( c );
        }
View Full Code Here

        if ( expression == null || expression.trim().equals( "" ) ) {
            throw new SAXParseException( "<predicate> must have some content",
                                         parser.getLocator() );
        }

        final PatternDescr patternDescr = (PatternDescr) parser.getParent();
       
        ExprConstraintDescr expr = new ExprConstraintDescr("eval(" + expression + ")");

        patternDescr.addConstraint( expr );

        return expr;
    }
View Full Code Here

        descr.setFieldName( name );
        return this;
    }

    public FieldDescrBuilder type( String type ) {
        descr.setPattern( new PatternDescr( type ) );
        return this;
    }
View Full Code Here

                    // classFieldAccessor requires both getter and setter
                    if (inspector.getSetterMethods().containsKey( name )) {
                        if (!inspector.isNonGetter( name ) && !"class".equals( name )) {
                            TypeFieldDescr inheritedFlDescr = new TypeFieldDescr(
                                                                                  name,
                                                                                  new PatternDescr(
                                                                                                    inspector.getFieldTypes().get( name ).getName() ) );
                            inheritedFlDescr.setInherited( !Modifier.isAbstract( inspector.getGetterMethods().get( name ).getModifiers() ) );

                            if (!fieldMap.containsKey( inheritedFlDescr.getFieldName() ))
                                fieldMap.put( inheritedFlDescr.getFieldName(),
View Full Code Here

TOP

Related Classes of org.drools.lang.descr.PatternDescr

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.