1 24 25 package org.objectweb.dream.xml; 26 27 import org.apache.xerces.parsers.SAXParser; 28 import org.objectweb.fractal.api.NoSuchInterfaceException; 29 import org.objectweb.fractal.api.control.BindingController; 30 import org.objectweb.fractal.api.control.IllegalBindingException; 31 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 32 import org.xml.sax.ContentHandler ; 33 34 40 public class SaxXercesParser extends SAXParser implements BindingController 41 { 42 43 46 public static final String CONTENT_HANDLER_ITF_NAME = "content-handler"; 47 48 51 public String [] listFc() 52 { 53 return new String []{CONTENT_HANDLER_ITF_NAME}; 54 } 55 56 59 public Object lookupFc(String clientItfName) throws NoSuchInterfaceException 60 { 61 if (clientItfName.equals(CONTENT_HANDLER_ITF_NAME)) 62 { 63 return getContentHandler(); 64 } 65 return null; 66 } 67 68 72 public void bindFc(String clientItfName, Object serverItf) 73 throws NoSuchInterfaceException, IllegalBindingException, 74 IllegalLifeCycleException 75 { 76 if (clientItfName.equals(CONTENT_HANDLER_ITF_NAME)) 77 { 78 setContentHandler((ContentHandler ) serverItf); 79 } 80 } 81 82 85 public void unbindFc(String clientItfName) throws NoSuchInterfaceException, 86 IllegalBindingException, IllegalLifeCycleException 87 { 88 if (clientItfName.equals(CONTENT_HANDLER_ITF_NAME)) 89 { 90 setContentHandler(null); 91 } 92 } 93 94 } | Popular Tags |