1 4 package com.tc.aspectwerkz.joinpoint.impl; 5 6 import com.tc.aspectwerkz.joinpoint.ConstructorRtti; 7 import com.tc.aspectwerkz.joinpoint.Rtti; 8 9 import java.lang.ref.WeakReference ; 10 import java.lang.reflect.Constructor ; 11 12 17 public class ConstructorRttiImpl implements ConstructorRtti { 18 private static final Object [] EMPTY_OBJECT_ARRAY = new Object []{}; 19 20 private final ConstructorSignatureImpl m_signature; 21 22 private WeakReference m_thisRef; 23 24 private WeakReference m_targetRef; 25 26 private Object [] m_parameterValues = EMPTY_OBJECT_ARRAY; 27 28 35 public ConstructorRttiImpl(final ConstructorSignatureImpl signature, 36 final Object thisInstance, 37 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 ConstructorRttiImpl(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 Constructor getConstructor() { 78 return m_signature.getConstructor(); 79 } 80 81 86 public Class getDeclaringType() { 87 return m_signature.getDeclaringType(); 88 } 89 90 99 public int getModifiers() { 100 return m_signature.getModifiers(); 101 } 102 103 108 public String getName() { 109 return m_signature.getName(); 110 } 111 112 117 public Class [] getExceptionTypes() { 118 return m_signature.getExceptionTypes(); 119 } 120 121 126 public Class [] getParameterTypes() { 127 return m_signature.getParameterTypes(); 128 } 129 130 135 public void setParameterValues(final Object [] parameterValues) { 136 m_parameterValues = parameterValues; 137 } 138 139 144 public Object [] getParameterValues() { 145 return m_parameterValues; 146 } 147 148 154 public String toString() { 155 return super.toString(); 156 } 157 158 } | Popular Tags |