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