1 8 package org.codehaus.aspectwerkz.joinpoint.impl; 9 10 import org.codehaus.aspectwerkz.joinpoint.CatchClauseRtti; 11 import org.codehaus.aspectwerkz.joinpoint.Rtti; 12 13 import java.lang.ref.WeakReference ; 14 15 20 public class CatchClauseRttiImpl implements CatchClauseRtti { 21 private final CatchClauseSignatureImpl m_signature; 22 23 private WeakReference m_thisRef; 24 25 private WeakReference m_targetRef; 26 27 private Object m_parameterValue; 28 29 36 public CatchClauseRttiImpl(final CatchClauseSignatureImpl signature, 37 final Object thisInstance, 38 final Object targetInstance) { 39 m_signature = signature; 40 m_thisRef = new WeakReference (thisInstance); 41 m_targetRef = new WeakReference (targetInstance); 42 } 43 44 51 public Rtti cloneFor(final Object thisInstance, final Object targetInstance) { 52 return new CatchClauseRttiImpl(m_signature, thisInstance, targetInstance); 53 } 54 55 60 public Object getThis() { 61 return m_thisRef.get(); 62 } 63 64 69 public Object getTarget() { 70 return m_targetRef.get(); 71 } 72 73 78 public Class getDeclaringType() { 79 return m_signature.getDeclaringType(); 80 } 81 82 91 public int getModifiers() { 92 return m_signature.getModifiers(); 93 } 94 95 100 public String getName() { 101 return m_signature.getName(); 102 } 103 104 109 public Class getParameterType() { 110 return m_signature.getParameterType(); 111 } 112 113 118 public Object getParameterValue() { 119 return getTarget(); } 121 122 128 public String toString() { 129 return super.toString(); 130 } 131 } | Popular Tags |