1 22 package org.jboss.aop; 23 24 import java.lang.reflect.Constructor ; 25 26 import org.jboss.aop.joinpoint.ConstructorJoinpoint; 27 import org.jboss.aop.joinpoint.Joinpoint; 28 import org.jboss.aop.util.MethodHashing; 29 30 36 public class ConstructionInfo extends JoinPointInfo 37 { 38 private Constructor constructor; 39 private int index; 40 41 public ConstructionInfo() 42 { 43 44 } 45 46 public ConstructionInfo(Class clazz, int index, long constructorHash, Advisor advisor) 47 { 48 super(advisor, clazz); 49 try 50 { 51 this.index = index; 52 this.constructor = MethodHashing.findConstructorByHash(clazz, constructorHash); 53 this.setAdvisor(advisor); 54 } 55 catch (Exception e) 56 { 57 throw new RuntimeException (e); 58 } 59 } 60 61 64 private ConstructionInfo(ConstructionInfo other) 65 { 66 super(other); 67 this.constructor = other.constructor; 68 this.index = other.index; 69 } 70 71 protected Joinpoint internalGetJoinpoint() 72 { 73 return new ConstructorJoinpoint(constructor); 74 } 75 76 public JoinPointInfo copy() 77 { 78 return new ConstructionInfo(this); 79 } 80 81 public String toString() 82 { 83 StringBuffer sb = new StringBuffer ("Construction"); 84 sb.append("["); 85 sb.append("constructor=" + constructor); 86 sb.append("]"); 87 return sb.toString(); 88 } 89 90 public void setConstructor(Constructor constructor) 91 { 92 this.constructor = constructor; 93 } 94 95 public Constructor getConstructor() 96 { 97 return constructor; 98 } 99 100 public void setIndex(int index) 101 { 102 this.index = index; 103 } 104 105 public int getIndex() 106 { 107 return index; 108 } 109 } 110 | Popular Tags |