Search in sources :

Example 1 with PatternDestinationDescr

use of org.drools.drl.ast.descr.PatternDestinationDescr in project drools by kiegroup.

the class PatternHandler method end.

public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    final PatternDescr patternDescr = (PatternDescr) parser.getCurrent();
    final Object parent = parser.getParent();
    if (parent instanceof PatternDestinationDescr) {
        final PatternDestinationDescr parentDescr = (PatternDestinationDescr) parent;
        parentDescr.setInputPattern(patternDescr);
    } else {
        final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
        parentDescr.addDescr(patternDescr);
    }
    return patternDescr;
}
Also used : PatternDescr(org.drools.drl.ast.descr.PatternDescr) PatternDestinationDescr(org.drools.drl.ast.descr.PatternDestinationDescr) Element(org.w3c.dom.Element) ConditionalElementDescr(org.drools.drl.ast.descr.ConditionalElementDescr)

Aggregations

ConditionalElementDescr (org.drools.drl.ast.descr.ConditionalElementDescr)1 PatternDescr (org.drools.drl.ast.descr.PatternDescr)1 PatternDestinationDescr (org.drools.drl.ast.descr.PatternDestinationDescr)1 Element (org.w3c.dom.Element)1