/** Reads the action associated to the given node. */ public Action readSingleAction(Element nodeElement) { // search for the first action element in the node for (Iterator iter = nodeElement.elementIterator(); iter.hasNext();) { Element candidate = (Element) iter.next(); if (ActionTypes.hasActionName(candidate.getName())) { // parse the action and assign it to this node return createAction(candidate); } } return null; }
/** Reads the action associated to the given node. */ public Action readSingleAction(Element nodeElement) { // search for the first action element in the node for (Iterator iter = nodeElement.elementIterator(); iter.hasNext();) { Element candidate = (Element) iter.next(); if (ActionTypes.hasActionName(candidate.getName())) { // parse the action and assign it to this node return createAction(candidate); } } return null; }
/** Reads actions associated to the given event. */ public void readActions(Element eventElement, GraphElement graphElement, String eventType) { // for all the elements in the event element for (Iterator iter = eventElement.elementIterator(); iter.hasNext();) { Element actionElement = (Element) iter.next(); if (ActionTypes.hasActionName(actionElement.getName())) { Action action = createAction(actionElement); if (graphElement != null && eventType != null) { // add the action to the event addAction(graphElement, eventType, action); } } } }
/** Reads actions associated to the given event. */ public void readActions(Element eventElement, GraphElement graphElement, String eventType) { // for all the elements in the event element for (Iterator iter = eventElement.elementIterator(); iter.hasNext();) { Element actionElement = (Element) iter.next(); if (ActionTypes.hasActionName(actionElement.getName())) { Action action = createAction(actionElement); if (graphElement != null && eventType != null) { // add the action to the event addAction(graphElement, eventType, action); } } } }
protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement) { // create the exception handler ExceptionHandler exceptionHandler = new ExceptionHandler(); exceptionHandler.setExceptionClassName(exceptionHandlerElement.attributeValue("exception-class")); // add it to the graph element graphElement.addExceptionHandler(exceptionHandler); // read the actions in the body of the exception-handler element for (Iterator iter = exceptionHandlerElement.elementIterator(); iter.hasNext();) { Element childElement = (Element) iter.next(); if (ActionTypes.hasActionName(childElement.getName())) { Action action = createAction(childElement); exceptionHandler.addAction(action); } } }
protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement) { // create the exception handler ExceptionHandler exceptionHandler = new ExceptionHandler(); exceptionHandler.setExceptionClassName(exceptionHandlerElement.attributeValue("exception-class")); // add it to the graph element graphElement.addExceptionHandler(exceptionHandler); // read the actions in the body of the exception-handler element for (Iterator iter = exceptionHandlerElement.elementIterator(); iter.hasNext();) { Element childElement = (Element) iter.next(); if (ActionTypes.hasActionName(childElement.getName())) { Action action = createAction(childElement); exceptionHandler.addAction(action); } } }