1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import javax.xml.namespace.NamespaceContext ; 25 import javax.xml.namespace.QName ; 26 27 import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; 28 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; 29 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; 30 import org.xml.sax.Attributes ; 31 32 38 public class ClassLoaderHandler extends DefaultElementHandler 39 { 40 41 public static final ClassLoaderHandler HANDLER = new ClassLoaderHandler(); 42 43 public Object startElement(Object parent, QName name, ElementBinding element) 44 { 45 return new AbstractClassLoaderMetaData(); 46 } 47 48 public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) 49 { 50 } 51 52 public Object endElement(Object o, QName qName, ElementBinding element) 53 { 54 AbstractClassLoaderMetaData classLoader = (AbstractClassLoaderMetaData) o; 55 if (classLoader.getClassLoader() == null) 56 throw new IllegalArgumentException ("ClassLoader should have a nested value."); 57 return classLoader; 58 } 59 } 60 | Popular Tags |