1 13 14 15 package org.aspectj.runtime.reflect; 16 17 import java.lang.reflect.Constructor ; 18 19 import org.aspectj.lang.reflect.ConstructorSignature; 20 21 class ConstructorSignatureImpl extends CodeSignatureImpl implements ConstructorSignature { 22 private Constructor constructor; 23 24 ConstructorSignatureImpl(int modifiers, Class declaringType, 25 Class [] parameterTypes, String [] parameterNames, Class [] exceptionTypes) 26 { 27 super(modifiers, "<init>", declaringType, parameterTypes, parameterNames, exceptionTypes); 28 } 29 30 ConstructorSignatureImpl(String stringRep) { 31 super(stringRep); 32 } 33 34 public String getName() { return "<init>"; } 35 36 protected String createToString(StringMaker sm) { 37 StringBuffer buf = new StringBuffer (); 38 buf.append(sm.makeModifiersString(getModifiers())); 39 buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName())); 40 sm.addSignature(buf, getParameterTypes()); 41 sm.addThrows(buf, getExceptionTypes()); 42 return buf.toString(); 43 } 44 45 48 public Constructor getConstructor() { 49 if (constructor == null) { 50 try { 51 constructor = getDeclaringType().getDeclaredConstructor(getParameterTypes()); 52 } catch (Exception ex) { 53 ; } 55 } 56 return constructor; 57 } 58 } 59 | Popular Tags |