1 22 package org.jboss.joinpoint.plugins; 23 24 import org.jboss.joinpoint.spi.ConstructorJoinpoint; 25 import org.jboss.reflect.spi.ConstructorInfo; 26 import org.jboss.util.UnreachableStatementException; 27 28 33 public class BasicConstructorJoinPoint implements ConstructorJoinpoint 34 { 35 36 protected ConstructorInfo constructorInfo; 37 38 39 protected Object [] arguments; 40 41 46 public BasicConstructorJoinPoint(ConstructorInfo constructorInfo) 47 { 48 this.constructorInfo = constructorInfo; 49 } 50 51 public ConstructorInfo getConstructorInfo() 52 { 53 return constructorInfo; 54 } 55 56 public Object [] getArguments() 57 { 58 return arguments; 59 } 60 61 public void setArguments(Object [] args) 62 { 63 this.arguments = args; 64 } 65 66 public Object clone() 67 { 68 try 69 { 70 return super.clone(); 71 } 72 catch (CloneNotSupportedException e) 73 { 74 throw new UnreachableStatementException(); 75 } 76 } 77 78 public Object dispatch() throws Throwable 79 { 80 return constructorInfo.newInstance(arguments); 81 } 82 83 public String toHumanReadableString() 84 { 85 return constructorInfo.toString(); 86 } 87 } 88 | Popular Tags |