1 4 package com.tc.aspectwerkz.joinpoint.impl; 5 6 import com.tc.aspectwerkz.joinpoint.FieldRtti; 7 import com.tc.aspectwerkz.joinpoint.Rtti; 8 9 import java.lang.ref.WeakReference ; 10 import java.lang.reflect.Field ; 11 12 17 public class FieldRttiImpl implements FieldRtti { 18 private final FieldSignatureImpl m_signature; 19 20 private WeakReference m_thisRef; 21 22 private WeakReference m_targetRef; 23 24 private Object m_fieldValue; 25 26 33 public FieldRttiImpl(final FieldSignatureImpl signature, final Object thisInstance, final Object targetInstance) { 34 m_signature = signature; 35 m_thisRef = new WeakReference (thisInstance); 36 m_targetRef = new WeakReference (targetInstance); 37 } 38 39 46 public Rtti cloneFor(final Object thisInstance, final Object targetInstance) { 47 return new FieldRttiImpl(m_signature, thisInstance, targetInstance); 48 } 49 50 55 public Object getTarget() { 56 return m_targetRef.get(); 57 } 58 59 64 public Object getThis() { 65 return m_thisRef.get(); 66 } 67 68 73 public Class getDeclaringType() { 74 return m_signature.getDeclaringType(); 75 } 76 77 86 public int getModifiers() { 87 return m_signature.getModifiers(); 88 } 89 90 95 public String getName() { 96 return m_signature.getName(); 97 } 98 99 104 public Field getField() { 105 return m_signature.getField(); 106 } 107 108 113 public Class getFieldType() { 114 return m_signature.getFieldType(); 115 } 116 117 122 public Object getFieldValue() { 123 return m_fieldValue; 124 } 125 126 131 public void setFieldValue(final Object fieldValue) { 132 m_fieldValue = fieldValue; 133 } 134 135 141 public String toString() { 142 return super.toString(); 143 } 144 145 150 public Object [] getParameterValues() { 151 return new Object []{m_fieldValue}; 152 } 153 } | Popular Tags |