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