1 22 package org.jboss.aop.joinpoint; 23 24 import java.lang.reflect.Constructor ; 25 import java.lang.reflect.Method ; 26 27 33 public class MethodCalledByConstructorJoinpoint implements Joinpoint 34 { 35 private final Constructor calling; 36 private final Method called; 37 38 public MethodCalledByConstructorJoinpoint(Constructor calling, Method called) 39 { 40 this.calling = calling; 41 this.called = called; 42 } 43 44 public boolean equals(Object o) 45 { 46 if (o == null) return false; 47 if (o == this) return true; 48 if (!(o instanceof MethodCalledByConstructorJoinpoint)) return false; 49 MethodCalledByConstructorJoinpoint jp = (MethodCalledByConstructorJoinpoint)o; 50 if (!jp.calling.equals(this.calling)) return false; 51 if (!jp.called.equals(this.called)) return false; 52 return true; 53 } 54 55 public int hashCode() 56 { 57 return calling.hashCode() + called.hashCode(); 58 } 59 60 public Constructor getCalling() 61 { 62 return calling; 63 } 64 65 public Method getCalled() 66 { 67 return called; 68 } 69 70 public String toString() 71 { 72 return called + " called by " + calling; 73 } 74 } 75 | Popular Tags |