1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import javax.xml.namespace.QName ; 25 26 import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; 27 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; 28 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; 29 30 36 public class SupplyHandler extends DefaultElementHandler 37 { 38 39 public static final SupplyHandler HANDLER = new SupplyHandler(); 40 41 public Object startElement(Object parent, QName name, ElementBinding element) 42 { 43 return new AbstractSupplyMetaData(); 44 } 45 46 public Object endElement(Object o, QName qName, ElementBinding element) 47 { 48 AbstractSupplyMetaData x = (AbstractSupplyMetaData) o; 49 String name = (String ) x.getSupply(); 50 if (name == null || name.trim().length() == 0) 51 throw new IllegalArgumentException ("Null or empty supply."); 52 return o; 53 } 54 } 55 | Popular Tags |