1 19 package org.netbeans.modules.xml.tools.generator; 20 21 import org.xml.sax.*; 22 23 public class SAXBindingsHandlerImpl implements SAXBindingsHandler { 24 25 private ParsletBindings parslets = new ParsletBindings(); 26 private ElementBindings elements = new ElementBindings(); 27 28 private static final String ATT_PARSLET = "parslet"; private static final String ATT_RETURN = "return"; 31 private static final String ATT_ELEMENT = "element"; private static final String ATT_TYPE = "type"; private static final String ATT_METHOD = "method"; 35 public ParsletBindings getParsletBindings() { 36 if (parslets.isEmpty()) return null; 37 return parslets; 38 } 39 40 public ElementBindings getElementBindings() { 41 if (elements.isEmpty()) return null; 42 return elements; 43 } 44 45 public void handle_parslet(final Attributes meta) throws SAXException { 46 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("handle_parslet: " + meta); 48 String parslet = meta.getValue(ATT_PARSLET); 49 String back = meta.getValue(ATT_RETURN); 50 51 parslets.put(parslet, back); 52 } 53 54 public void start_SAX_bindings(final Attributes meta) throws SAXException { 55 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("start_SAX_bindings: " + meta); 57 } 58 59 public void end_SAX_bindings() throws SAXException { 60 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("end_SAX_bindings()"); } 62 63 public void start_bind(final Attributes meta) throws SAXException { 64 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("start_bind: " + meta); 66 String element = meta.getValue(ATT_ELEMENT); 67 String method = meta.getValue(ATT_METHOD); 68 String parslet = meta.getValue(ATT_PARSLET); 69 String type = meta.getValue(ATT_TYPE); 70 71 elements.put(element, method, parslet, type); 72 } 73 74 public void end_bind() throws SAXException { 75 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("end_bind()"); } 77 78 82 public void handle_attbind(Attributes meta) throws SAXException { 83 } 84 85 } 86 | Popular Tags |