/** * Find a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the constructor metadata * @param object an opaque object * @return the constructor join point * @throws Exception for any error */ public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData, Object object) throws Exception { ConstructorInfo cinfo = resolveConstructor(trace, info, metaData); JoinpointFactory jpf = info.getJoinpointFactory(); if (object == null) return jpf.getConstructorJoinpoint(cinfo); else return jpf.getConstructorJoinpoint(cinfo, object); }
/** * Get a constructor Joinpoint * * @param jpf the join point factory * @param paramTypes the parameter types * @param params the parameters * @return the Joinpoint * @throws Throwable for any error */ public static ConstructorJoinpoint getConstructorJoinpoint(JoinpointFactory jpf, String[] paramTypes, Object[] params) throws Throwable { if (paramTypes == null) paramTypes = NO_PARAMS_TYPES; if (params == null) params = NO_PARAMS; boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get constructor Joinpoint jpf=" + jpf + " paramTypes=" + Arrays.asList(paramTypes) + " params=" + Arrays.asList(params)); ConstructorInfo constructorInfo = findConstructorInfo(jpf.getClassInfo(), paramTypes); ConstructorJoinpoint joinpoint = jpf.getConstructorJoinpoint(constructorInfo); joinpoint.setArguments(params); return joinpoint; }
/** * Get a constructor Joinpoint * * @param jpf the join point factory * @param paramTypes the parameter types * @param params the parameters * @return the Joinpoint * @throws Throwable for any error */ public static ConstructorJoinpoint getConstructorJoinpoint(JoinpointFactory jpf, String[] paramTypes, Object[] params) throws Throwable { if (paramTypes == null) paramTypes = NO_PARAMS_TYPES; if (params == null) params = NO_PARAMS; boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get constructor Joinpoint jpf=" + jpf + " paramTypes=" + Arrays.asList(paramTypes) + " params=" + Arrays.asList(params)); ConstructorInfo constructorInfo = findConstructorInfo(jpf.getClassInfo(), paramTypes); ConstructorJoinpoint joinpoint = jpf.getConstructorJoinpoint(constructorInfo); joinpoint.setArguments(params); return joinpoint; }