KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > validate > nrl > AttachAction


1 package com.thaiopensource.validate.nrl;
2
3 import com.thaiopensource.validate.Validator;
4 import com.thaiopensource.validate.nrl.Mode;
5 import com.thaiopensource.validate.nrl.ModeUsage;
6 import org.xml.sax.ContentHandler JavaDoc;
7
8 class AttachAction extends ResultAction {
9   AttachAction(ModeUsage modeUsage) {
10     super(modeUsage);
11   }
12
13   void perform(ContentHandler JavaDoc handler, SectionState state) {
14     final ModeUsage modeUsage = getModeUsage();
15     if (handler != null)
16       state.addActiveHandler(handler, modeUsage);
17     else
18       state.addAttributeValidationModeUsage(modeUsage);
19     state.addChildMode(modeUsage, handler);
20   }
21
22   ResultAction changeCurrentMode(Mode mode) {
23     return new AttachAction(getModeUsage().changeCurrentMode(mode));
24   }
25 }
26
Popular Tags