1 22 package org.jboss.aop.joinpoint; 23 24 import org.jboss.aop.FieldInfo; 25 import org.jboss.aop.advice.Interceptor; 26 27 import java.lang.reflect.Field ; 28 29 37 public abstract class FieldInvocation extends InvocationBase 38 { 39 private static final long serialVersionUID = -6040602776393748583L; 40 41 protected transient Field field = null; 42 protected int index; 43 44 public FieldInvocation(Field field, int fieldIndex, Interceptor[] interceptors) 45 { 46 super(interceptors); 47 this.field = field; 48 this.index = fieldIndex; 49 } 50 51 protected FieldInvocation(Interceptor[] interceptors) 52 { 53 super(interceptors); 54 } 55 56 protected FieldInvocation(FieldInfo info, Interceptor[] interceptors) 57 { 58 this(info.getAdvisedField(), info.getIndex(), interceptors); 59 this.advisor = info.getAdvisor(); 60 } 61 62 66 public Object resolveAnnotation(Class annotation) 67 { 68 Object val = super.resolveAnnotation(annotation); 69 if (val != null) return val; 70 71 if (getAdvisor() != null) 72 { 73 val = getAdvisor().resolveAnnotation(field, annotation); 74 if (val != null) return val; 75 } 76 77 return null; 78 } 79 88 public Object getMetaData(Object group, Object attr) 89 { 90 Object val = super.getMetaData(group, attr); 91 if (val != null) return val; 92 93 if (getAdvisor() != null) 94 { 95 val = getAdvisor().getFieldMetaData().resolve(this, group, attr); 96 if (val != null) return val; 97 } 98 99 if (getAdvisor() != null) 100 { 101 val = getAdvisor().getDefaultMetaData().resolve(this, group, attr); 102 if (val != null) return val; 103 } 104 105 return null; 106 } 107 108 113 public Field getField() 114 { 115 return field; 116 } 117 118 123 public int getIndex() 124 { 125 return index; 126 } 127 128 } 129 | Popular Tags |