1 8 package org.codehaus.aspectwerkz.joinpoint.impl; 9 10 import org.codehaus.aspectwerkz.joinpoint.ConstructorRtti; 11 import org.codehaus.aspectwerkz.joinpoint.Rtti; 12 13 import java.lang.ref.WeakReference ; 14 import java.lang.reflect.Constructor ; 15 16 21 public class ConstructorRttiImpl implements ConstructorRtti { 22 private static final Object [] EMPTY_OBJECT_ARRAY = new Object []{}; 23 24 private final ConstructorSignatureImpl m_signature; 25 26 private WeakReference m_thisRef; 27 28 private WeakReference m_targetRef; 29 30 private Object [] m_parameterValues = EMPTY_OBJECT_ARRAY; 31 32 39 public ConstructorRttiImpl(final ConstructorSignatureImpl signature, 40 final Object thisInstance, 41 final Object targetInstance) { 42 m_signature = signature; 43 m_thisRef = new WeakReference (thisInstance); 44 m_targetRef = new WeakReference (targetInstance); 45 } 46 47 54 public Rtti cloneFor(final Object thisInstance, final Object targetInstance) { 55 return new ConstructorRttiImpl(m_signature, thisInstance, targetInstance); 56 } 57 58 63 public Object getTarget() { 64 return m_targetRef.get(); 65 } 66 67 72 public Object getThis() { 73 return m_thisRef.get(); 74 } 75 76 81 public Constructor getConstructor() { 82 return m_signature.getConstructor(); 83 } 84 85 90 public Class getDeclaringType() { 91 return m_signature.getDeclaringType(); 92 } 93 94 103 public int getModifiers() { 104 return m_signature.getModifiers(); 105 } 106 107 112 public String getName() { 113 return m_signature.getName(); 114 } 115 116 121 public Class [] getExceptionTypes() { 122 return m_signature.getExceptionTypes(); 123 } 124 125 130 public Class [] getParameterTypes() { 131 return m_signature.getParameterTypes(); 132 } 133 134 139 public void setParameterValues(final Object [] parameterValues) { 140 m_parameterValues = parameterValues; 141 } 142 143 148 public Object [] getParameterValues() { 149 return m_parameterValues; 150 } 151 152 158 public String toString() { 159 return super.toString(); 160 } 161 162 } | Popular Tags |