1 23 package org.objectweb.clif.scenario.util.isac.plugin; 24 25 import java.util.Hashtable ; 26 27 import org.xml.sax.Attributes ; 28 import org.xml.sax.helpers.DefaultHandler ; 29 30 37 public class PluginDescriptionFileHandler extends DefaultHandler { 38 private String methodName ; 40 private String number ; 41 private String clazzName ; 42 private String pluginName ; 43 private Hashtable pluginSessionObjectClassTable ; 44 private Hashtable methodNameConversionTable ; 45 51 public PluginDescriptionFileHandler(String pluginName, Hashtable psoct, Hashtable mnct) { 52 super(); 53 this.clazzName = null ; 54 this.methodName = null ; 55 this.number = null ; 56 this.pluginName = pluginName ; 57 this.pluginSessionObjectClassTable = psoct ; 58 this.methodNameConversionTable = mnct ; 59 } 60 61 64 public void startElement( 65 String namespaceURI, 66 String localName, 67 String qName, 68 Attributes atts) { 69 if (qName.equals("sample")) { 70 this.methodName = atts.getValue(0); 71 this.number = atts.getValue(1); 72 } else if (qName.equals("object")) { 73 this.methodName = "SessionObject"; 75 this.clazzName = atts.getValue(0); 76 } else if (qName.equals("timer")) { 77 this.methodName = atts.getValue(0); 78 this.number = atts.getValue(1); 79 } else if (qName.equals("test")) { 80 this.methodName = atts.getValue(0); 81 this.number = atts.getValue(1); 82 } else if (qName.equals("params")) { 83 } else if (qName.equals("param")) { 85 } else if (qName.equals("plugin")) { 87 } else if (qName.equals("help")) { 89 } 91 } 92 93 96 public void endElement( 97 String namespaceURI, 98 String localName, 99 String qName) { 100 if (qName.equals("sample") || qName.equals("timer") || qName.equals("test")) { 101 String key = this.pluginName + "." + qName + "." + this.methodName ; 102 this.methodNameConversionTable.put(key, new Integer (this.number)) ; 104 } else if (qName.equals("object")) { 105 this.pluginSessionObjectClassTable.put(this.pluginName, this.clazzName) ; 107 } 108 } 109 110 public void characters(char[] ch, int debut, int l) { 111 } 113 } 114 | Popular Tags |