public Interpreter(Context context, RuleStore rs, ElementPath initialElementPath) { this.cai = new CAI_WithLocatorSupport(context, this); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.elementPath = initialElementPath; actionListStack = new Stack<List<Action>>(); eventPlayer = new EventPlayer(this); }
private void callEndAction(List<Action> applicableActionList, String tagName) { if (applicableActionList == null) { return; } // logger.debug("About to call end actions on node: [" + localName + "]"); Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); // now let us invoke the end method of the action. We catch and report // any eventual exceptions try { action.end(interpretationContext, tagName); } catch (ActionException ae) { // at this point endAction, there is no point in skipping children as // they have been already processed cai.addError("ActionException in Action for tag [" + tagName + "]", ae); } catch (RuntimeException e) { // no point in setting skip cai.addError("RuntimeException in Action for tag [" + tagName + "]", e); } } }
public Interpreter(Context context, RuleStore rs, Pattern initialPattern) { this.cai = new CAI_WithLocatorSupport(this); this.cai.setContext(context); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.pattern = initialPattern; actionListStack = new Stack<List>(); player = new EventPlayer(this); }
public Interpreter(Context context, RuleStore rs, Pattern initialPattern) { this.cai = new CAI_WithLocatorSupport(this); this.cai.setContext(context); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.pattern = initialPattern; actionListStack = new Stack<List>(); eventPlayer = new EventPlayer(this); }
private void callBodyAction(List<Action> applicableActionList, String body) { if (applicableActionList == null) { return; } Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); try { action.body(interpretationContext, body); } catch (ActionException ae) { cai .addError("Exception in end() methd for action [" + action + "]", ae); } } }
public Interpreter(Context context, RuleStore rs, ElementPath initialElementPath) { this.cai = new CAI_WithLocatorSupport(context, this); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.elementPath = initialElementPath; actionListStack = new Stack<List<Action>>(); eventPlayer = new EventPlayer(this); }
public Interpreter(Context context, RuleStore rs, Pattern initialPattern) { this.cai = new CAI_WithLocatorSupport(this); this.cai.setContext(context); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.pattern = initialPattern; actionListStack = new Stack<List>(); eventPlayer = new EventPlayer(this); }
void callBeginAction(List<Action> applicableActionList, String tagName, Attributes atts) { if (applicableActionList == null) { return; } Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = (Action) i.next(); // now let us invoke the action. We catch and report any eventual // exceptions try { action.begin(interpretationContext, tagName, atts); } catch (ActionException e) { skip = elementPath.duplicate(); cai.addError("ActionException in Action for tag [" + tagName + "]", e); } catch (RuntimeException e) { skip = elementPath.duplicate(); cai.addError("RuntimeException in Action for tag [" + tagName + "]", e); } } }
public Interpreter(Context context, RuleStore rs, ElementPath initialElementPath) { this.cai = new CAI_WithLocatorSupport(context, this); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.elementPath = initialElementPath; actionListStack = new Stack<List<Action>>(); eventPlayer = new EventPlayer(this); }
private void startElement(String namespaceURI, String localName, String qName, Attributes atts) { String tagName = getTagName(localName, qName); elementPath.push(tagName); if (skip != null) { // every startElement pushes an action list pushEmptyActionList(); return; } List<Action> applicableActionList = getApplicableActionList(elementPath, atts); if (applicableActionList != null) { actionListStack.add(applicableActionList); callBeginAction(applicableActionList, tagName, atts); } else { // every startElement pushes an action list pushEmptyActionList(); String errMsg = "no applicable action for [" + tagName + "], current ElementPath is [" + elementPath + "]"; cai.addError(errMsg); } }
public Interpreter(Context context, RuleStore rs, ElementPath initialElementPath) { this.cai = new CAI_WithLocatorSupport(context, this); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.elementPath = initialElementPath; actionListStack = new Stack<List<Action>>(); eventPlayer = new EventPlayer(this); }
private void callEndAction(List<Action> applicableActionList, String tagName) { if (applicableActionList == null) { return; } // logger.debug("About to call end actions on node: [" + localName + "]"); Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); // now let us invoke the end method of the action. We catch and report // any eventual exceptions try { action.end(interpretationContext, tagName); } catch (ActionException ae) { // at this point endAction, there is no point in skipping children as // they have been already processed cai.addError("ActionException in Action for tag [" + tagName + "]", ae); } catch (RuntimeException e) { // no point in setting skip cai.addError("RuntimeException in Action for tag [" + tagName + "]", e); } } }
public Interpreter(Context context, RuleStore rs, ElementPath initialElementPath) { this.cai = new CAI_WithLocatorSupport(context, this); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.elementPath = initialElementPath; actionListStack = new Stack<List<Action>>(); eventPlayer = new EventPlayer(this); }
private void callBodyAction(List<Action> applicableActionList, String body) { if (applicableActionList == null) { return; } Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); try { action.body(interpretationContext, body); } catch (ActionException ae) { cai.addError("Exception in end() methd for action [" + action + "]", ae); } } }
public Interpreter(Context context, RuleStore rs, ElementPath initialElementPath) { this.cai = new CAI_WithLocatorSupport(context, this); ruleStore = rs; interpretationContext = new InterpretationContext(context, this); implicitActions = new ArrayList<ImplicitAction>(3); this.elementPath = initialElementPath; actionListStack = new Stack<List<Action>>(); eventPlayer = new EventPlayer(this); }
private void callBodyAction(List<Action> applicableActionList, String body) { if (applicableActionList == null) { return; } Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); try { action.body(interpretationContext, body); } catch (ActionException ae) { cai.addError("Exception in end() methd for action [" + action + "]", ae); } } }
private void callBodyAction(List<Action> applicableActionList, String body) { if (applicableActionList == null) { return; } Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); try { action.body(interpretationContext, body); } catch (ActionException ae) { cai.addError("Exception in end() methd for action [" + action + "]", ae); } } }
private void callBodyAction(List<Action> applicableActionList, String body) { if (applicableActionList == null) { return; } Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); try { action.body(interpretationContext, body); } catch (ActionException ae) { cai .addError("Exception in end() methd for action [" + action + "]", ae); } } }
private void callEndAction(List applicableActionList, String tagName) { if (applicableActionList == null) { return; } // logger.debug("About to call end actions on node: [" + localName + "]"); Iterator i = applicableActionList.iterator(); while (i.hasNext()) { Action action = (Action) i.next(); // now let us invoke the end method of the action. We catch and report // any eventual exceptions try { action.end(interpretationContext, tagName); } catch (ActionException ae) { // at this point endAction, there is no point in skipping children as // they have been already processed cai.addError("ActionException in Action for tag [" + tagName + "]", ae); } catch (RuntimeException e) { // no point in setting skip cai.addError("RuntimeException in Action for tag [" + tagName + "]", e); } } }
private void callEndAction(List<Action> applicableActionList, String tagName) { if (applicableActionList == null) { return; } // logger.debug("About to call end actions on node: [" + localName + "]"); Iterator<Action> i = applicableActionList.iterator(); while (i.hasNext()) { Action action = i.next(); // now let us invoke the end method of the action. We catch and report // any eventual exceptions try { action.end(interpretationContext, tagName); } catch (ActionException ae) { // at this point endAction, there is no point in skipping children as // they have been already processed cai.addError("ActionException in Action for tag [" + tagName + "]", ae); } catch (RuntimeException e) { // no point in setting skip cai.addError("RuntimeException in Action for tag [" + tagName + "]", e); } } }