/** * @param declaringType The declaring type * @param methodName The method name * @param arguments The arguments */ AbstractExecutable(Class declaringType, String methodName, Argument[] arguments) { Objects.requireNonNull(declaringType, "Declaring type cannot be null"); Objects.requireNonNull(methodName, "Method name cannot be null"); this.argTypes = Argument.toClassArray(arguments); this.declaringType = declaringType; this.methodName = methodName; if (ArrayUtils.isNotEmpty(arguments)) { this.arguments = arguments; } else { this.arguments = Argument.ZERO_ARGUMENTS; } }
/** * @param declaringType The declaring type * @param methodName The method name * @param arguments The arguments */ AbstractExecutable(Class declaringType, String methodName, Argument[] arguments) { Objects.requireNonNull(declaringType, "Declaring type cannot be null"); Objects.requireNonNull(methodName, "Method name cannot be null"); this.argTypes = Argument.toClassArray(arguments); this.declaringType = declaringType; this.methodName = methodName; if (ArrayUtils.isNotEmpty(arguments)) { this.arguments = arguments; } else { this.arguments = Argument.ZERO_ARGUMENTS; } }
/** * @param declaringBean The declaring bean * @param declaringType The declaring class type * @param annotationMetadata The annotation metadata * @param arguments The arguments */ DefaultConstructorInjectionPoint( BeanDefinition<T> declaringBean, Class<T> declaringType, AnnotationMetadata annotationMetadata, Argument<?>[] arguments) { this.argTypes = Argument.toClassArray(arguments); this.declaringBean = declaringBean; this.declaringType = declaringType; if (!(annotationMetadata instanceof DefaultAnnotationMetadata)) { this.annotationMetadata = AnnotationMetadata.EMPTY_METADATA; } else { this.annotationMetadata = new ConstructorAnnotationMetadata((DefaultAnnotationMetadata) annotationMetadata); } this.arguments = arguments == null ? Argument.ZERO_ARGUMENTS : arguments; }
/** * @param declaringBean The declaring bean * @param declaringType The declaring class type * @param annotationMetadata The annotation metadata * @param arguments The arguments */ DefaultConstructorInjectionPoint( BeanDefinition<T> declaringBean, Class<T> declaringType, AnnotationMetadata annotationMetadata, Argument<?>[] arguments) { this.argTypes = Argument.toClassArray(arguments); this.declaringBean = declaringBean; this.declaringType = declaringType; if (!(annotationMetadata instanceof DefaultAnnotationMetadata)) { this.annotationMetadata = AnnotationMetadata.EMPTY_METADATA; } else { this.annotationMetadata = new ConstructorAnnotationMetadata((DefaultAnnotationMetadata) annotationMetadata); } this.arguments = arguments == null ? Argument.ZERO_ARGUMENTS : arguments; }
/** * Constructs a new {@link DefaultMethodInjectionPoint}. * * @param declaringBean The declaring bean * @param declaringType The declaring type * @param methodName The method name * @param arguments The arguments * @param annotationMetadata The annotation metadata */ DefaultMethodInjectionPoint( BeanDefinition declaringBean, Class<?> declaringType, String methodName, @Nullable Argument[] arguments, @Nullable AnnotationMetadata annotationMetadata) { Objects.requireNonNull(declaringBean, "Declaring bean cannot be null"); this.declaringType = declaringType; this.methodName = methodName; this.arguments = arguments == null ? Argument.ZERO_ARGUMENTS : arguments; this.argTypes = Argument.toClassArray(arguments); this.declaringBean = declaringBean; this.annotationMetadata = initAnnotationMetadata(annotationMetadata); }
/** * Constructs a new {@link DefaultMethodInjectionPoint}. * * @param declaringBean The declaring bean * @param declaringType The declaring type * @param methodName The method name * @param arguments The arguments * @param annotationMetadata The annotation metadata */ DefaultMethodInjectionPoint( BeanDefinition declaringBean, Class<?> declaringType, String methodName, @Nullable Argument[] arguments, @Nullable AnnotationMetadata annotationMetadata) { Objects.requireNonNull(declaringBean, "Declaring bean cannot be null"); this.declaringType = declaringType; this.methodName = methodName; this.arguments = arguments == null ? Argument.ZERO_ARGUMENTS : arguments; this.argTypes = Argument.toClassArray(arguments); this.declaringBean = declaringBean; this.annotationMetadata = initAnnotationMetadata(annotationMetadata); }
private Constructor<T> resolveConstructor() { Constructor<T> constructor = this.constructor; if (constructor == null) { synchronized (this) { // double check constructor = this.constructor; if (constructor == null) { constructor = ReflectionUtils.findConstructor(declaringType, Argument.toClassArray(arguments)) .orElseThrow(() -> new BeanInstantiationException( declaringComponent, "No constructor found for arguments: " + Argument.toString(arguments) ) ); this.constructor = constructor; } } } return constructor; }
private Constructor<T> resolveConstructor() { Constructor<T> constructor = this.constructor; if (constructor == null) { synchronized (this) { // double check constructor = this.constructor; if (constructor == null) { constructor = ReflectionUtils.findConstructor(declaringType, Argument.toClassArray(arguments)) .orElseThrow(() -> new BeanInstantiationException( declaringComponent, "No constructor found for arguments: " + Argument.toString(arguments) ) ); this.constructor = constructor; } } } return constructor; }