1 8 package org.codehaus.aspectwerkz.joinpoint.impl; 9 10 import org.codehaus.aspectwerkz.joinpoint.FieldRtti; 11 import org.codehaus.aspectwerkz.joinpoint.Rtti; 12 13 import java.lang.ref.WeakReference ; 14 import java.lang.reflect.Field ; 15 16 21 public class FieldRttiImpl implements FieldRtti { 22 private final FieldSignatureImpl m_signature; 23 24 private WeakReference m_thisRef; 25 26 private WeakReference m_targetRef; 27 28 private Object m_fieldValue; 29 30 37 public FieldRttiImpl(final FieldSignatureImpl signature, final Object thisInstance, final Object targetInstance) { 38 m_signature = signature; 39 m_thisRef = new WeakReference (thisInstance); 40 m_targetRef = new WeakReference (targetInstance); 41 } 42 43 50 public Rtti cloneFor(final Object thisInstance, final Object targetInstance) { 51 return new FieldRttiImpl(m_signature, thisInstance, targetInstance); 52 } 53 54 59 public Object getTarget() { 60 return m_targetRef.get(); 61 } 62 63 68 public Object getThis() { 69 return m_thisRef.get(); 70 } 71 72 77 public Class getDeclaringType() { 78 return m_signature.getDeclaringType(); 79 } 80 81 90 public int getModifiers() { 91 return m_signature.getModifiers(); 92 } 93 94 99 public String getName() { 100 return m_signature.getName(); 101 } 102 103 108 public Field getField() { 109 return m_signature.getField(); 110 } 111 112 117 public Class getFieldType() { 118 return m_signature.getFieldType(); 119 } 120 121 126 public Object getFieldValue() { 127 return m_fieldValue; 128 } 129 130 135 public void setFieldValue(final Object fieldValue) { 136 m_fieldValue = fieldValue; 137 } 138 139 145 public String toString() { 146 return super.toString(); 147 } 148 149 154 public Object [] getParameterValues() { 155 return new Object []{m_fieldValue}; 156 } 157 } | Popular Tags |