1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import java.util.HashSet ; 25 import java.util.Set ; 26 27 import javax.xml.namespace.QName ; 28 29 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; 30 import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; 31 import org.jboss.beans.metadata.spi.SupplyMetaData; 32 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; 33 34 40 public class BeanSuppliesInterceptor extends DefaultElementInterceptor 41 { 42 43 public static final BeanSuppliesInterceptor INTERCEPTOR = new BeanSuppliesInterceptor(); 44 45 public void add(Object parent, Object child, QName name) 46 { 47 AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; 48 AbstractSupplyMetaData supply = (AbstractSupplyMetaData) child; 49 Set <SupplyMetaData> supplies = bean.getSupplies(); 50 if (supplies == null) 51 { 52 supplies = new HashSet <SupplyMetaData>(); 53 bean.setSupplies(supplies); 54 } 55 supplies.add(supply); 56 } 57 } 58 | Popular Tags |