| 1 22 package org.jboss.reflect.plugins.javassist; 23 24 import java.lang.annotation.Annotation ; 25 26 import org.jboss.reflect.plugins.AnnotationHelper; 27 import org.jboss.reflect.spi.AnnotationInfo; 28 import org.jboss.reflect.spi.AnnotationValue; 29 import org.jboss.reflect.spi.ClassInfo; 30 import org.jboss.reflect.spi.ParameterInfo; 31 import org.jboss.reflect.spi.TypeInfo; 32 33 38 public abstract class JavassistAnnotatedParameterInfo extends JavassistAnnotatedInfo 39 { 40 41 protected transient ParameterInfo[] parameters; 42 43 44 protected transient TypeInfo[] parameterTypes; 45 46 47 protected transient ClassInfo[] exceptionTypes; 48 49 50 protected JavassistTypeInfo typeInfo; 51 52 public JavassistAnnotatedParameterInfo(AnnotationHelper annotationHelper) 53 { 54 super(annotationHelper); 55 } 56 57 58 protected void setupParameterAnnotations(Object [][] annotations) 59 { 60 for (int param = 0 ; param < annotations.length ; param++) 61 { 62 AnnotationValue[] annotationValues = new AnnotationValue[annotations[param].length]; 63 for (int ann = 0 ; ann < annotations.length ; ann++) 64 { 65 Class clazz = ((Annotation )annotations[param][ann]).annotationType(); 66 67 AnnotationInfo info = (AnnotationInfo)((JavassistTypeInfoFactoryImpl)annotationHelper).getTypeInfo(clazz); 68 annotationValues[ann] = annotationHelper.createAnnotationValue(info, annotations[param][ann]); 69 } 70 ((JavassistParameterInfo)parameters[param]).setAnnotations(annotationValues); 71 } 72 } 73 74 protected abstract void createParameterAnnotations(); 75 76 } 77 | Popular Tags |