Search in sources :

Example 1 with PatternDestinationDescr

use of org.drools.compiler.lang.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.compiler.lang.descr.PatternDescr) PatternDestinationDescr(org.drools.compiler.lang.descr.PatternDestinationDescr) Element(org.w3c.dom.Element) ConditionalElementDescr(org.drools.compiler.lang.descr.ConditionalElementDescr)

Aggregations

ConditionalElementDescr (org.drools.compiler.lang.descr.ConditionalElementDescr)1 PatternDescr (org.drools.compiler.lang.descr.PatternDescr)1 PatternDestinationDescr (org.drools.compiler.lang.descr.PatternDestinationDescr)1 Element (org.w3c.dom.Element)1