public Object end(final String uri,
final String localName,
final ExtensibleXmlParser parser) throws SAXException {
Element element = parser.endElementBuilder();
EventBasedNode eventBasedNode = (EventBasedNode) parser.getParent();
String id = element.getAttribute("id");
emptyAttributeCheck( localName, "id", id, parser );
String delay = element.getAttribute("delay");
String period = element.getAttribute("period");
Timer timer = new Timer();
timer.setId(new Long(id));
if (delay != null && delay.length() != 0 ) {
timer.setDelay(new Long(delay));
}
if (period != null && period.length() != 0 ) {
timer.setPeriod(new Long(period));
}
org.w3c.dom.Node xmlNode = element.getFirstChild();
DroolsAction action = null;
if (xmlNode instanceof Element) {
Element actionXml = (Element) xmlNode;
action = AbstractNodeHandler.extractAction(actionXml);
}
eventBasedNode.addTimer(timer, action);
return null;
}