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.AbstractAnnotationMetaData; 30 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; 31 import org.jboss.beans.metadata.spi.AnnotationMetaData; 32 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; 33 34 40 public class BeanAnnotationInterceptor extends DefaultElementInterceptor 41 { 42 43 public static final BeanAnnotationInterceptor INTERCEPTOR = new BeanAnnotationInterceptor(); 44 45 public void add(Object parent, Object child, QName name) 46 { 47 AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; 48 AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) child; 49 Set <AnnotationMetaData> annotations = bean.getAnnotations(); 50 if (annotations == null) 51 { 52 annotations = new HashSet <AnnotationMetaData>(); 53 bean.setAnnotations(annotations); 54 } 55 annotations.add(annotation); 56 } 57 } 58 | Popular Tags |