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.AbstractDependencyMetaData; 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 DependsHandler extends DefaultElementHandler 39 { 40 41 public static final DependsHandler HANDLER = new DependsHandler(); 42 43 public Object startElement(Object parent, QName name, ElementBinding element) 44 { 45 return new AbstractDependencyMetaData(); 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 AbstractDependencyMetaData x = (AbstractDependencyMetaData) o; 55 String name = (String ) x.getDependency(); 56 if (name == null || name.trim().length() == 0) 57 throw new IllegalArgumentException ("Null or empty dependency."); 58 return o; 59 } 60 } 61 | Popular Tags |