@Override public Constructor getJavaMember() { return ctor.getJavaMember(); }
@Override public Constructor<T> getConstructor() { return injectionPoint.getAnnotated().getJavaMember(); }
@Override default <T extends Annotation> Set<T> getAnnotations(Class<T> annotationType) { T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType); return new LinkedHashSet<>(asList(annotationsByType)); } }
configurator.filterConstructors(constructor -> !Modifier.isPrivate(constructor.getJavaMember().getModifiers())) .forEach(constructor -> { METRIC_ANNOTATIONS.forEach(annotation -> { LookupResult<? extends Annotation> lookupResult = lookupAnnotation(constructor.getAnnotated().getJavaMember(), annotation, clazz); if (lookupResult != null) { registerMetric(constructor.getAnnotated().getJavaMember(), clazz, lookupResult);
@SuppressWarnings("unchecked") @Override public T aroundConstruct(ConstructionHandle<T> ctx, AnnotatedConstructor<T> constructor, Object[] parameters, Map<String, Object> data) throws Exception { context.putPrivateData(ConstructionHandle.class, ctx); context.setParameters(parameters); context.setContextData(data); context.setConstructor(constructor.getJavaMember()); context.proceed(); // proceed with the WF interceptor chain return (T) context.getTarget(); } });
private <T> void determineConstrainedConstructors(AnnotatedType<T> type, BeanDescriptor beanDescriptor, Set<AnnotatedCallable<? super T>> callables) { Class<?> clazz = type.getJavaClass(); EnumSet<ExecutableType> classLevelExecutableTypes = executableTypesDefinedOnType( clazz ); for ( AnnotatedConstructor<T> annotatedConstructor : type.getConstructors() ) { Constructor<?> constructor = annotatedConstructor.getJavaMember(); EnumSet<ExecutableType> memberLevelExecutableType = executableTypesDefinedOnConstructor( constructor ); if ( veto( classLevelExecutableTypes, memberLevelExecutableType, ExecutableType.CONSTRUCTORS ) ) { continue; } if ( beanDescriptor.getConstraintsForConstructor( constructor.getParameterTypes() ) != null ) { callables.add( annotatedConstructor ); } } }
/** * Gets the constructor * * @return The constructor */ public Constructor<T> getAnnotatedConstructor() { return slim.getJavaMember(); }
/** * Gets the delegate (constructor) * * @return The delegate */ @Override public Constructor<T> getDelegate() { return slim.getJavaMember(); }
@Override default <T extends Annotation> Set<T> getAnnotations(Class<T> annotationType) { T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType); return new LinkedHashSet<>(asList(annotationsByType)); } }
@Override public Constructor<X> getJavaMember() { return delegate().getJavaMember(); } }
@Override public Constructor<T> getConstructor() { if (constructor == null) { // TODO: isolate this into a special non-producible instantiator return null; } return constructor.getAnnotated().getJavaMember(); }
@Override public Constructor<T> getConstructor() { if (constructor == null) { return null; } return constructor.getAnnotated().getJavaMember(); }
/** * Gets the java.lang.reflect.Constructor wrapped by this * * @return the Constructor */ public Constructor<X> getJavaMember() { return getDelegate().getJavaMember(); }
@Override protected boolean matches(InjectionPoint ip, AnnotatedCallable<?> annotatedCallable) { if (annotatedCallable instanceof AnnotatedConstructor<?>) { AnnotatedConstructor<?> annotatedConstructor = Reflections.cast(annotatedCallable); return constructor.get().equals(annotatedConstructor.getJavaMember()); } return false; } }
@Override protected boolean matches(InjectionPoint ip, AnnotatedCallable<?> annotatedCallable) { if (annotatedCallable instanceof AnnotatedConstructor<?>) { AnnotatedConstructor<?> annotatedConstructor = Reflections.cast(annotatedCallable); return constructor.get().equals(annotatedConstructor.getJavaMember()); } return false; } }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
protected SubclassedComponentInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, ConstructorInjectionPoint<T> originalConstructor, BeanManagerImpl manager) { EnhancedAnnotatedConstructor<T> constructorForEnhancedSubclass = initEnhancedSubclass(manager, type, bean, originalConstructor); this.proxyClassConstructorInjectionPoint = new ProxyClassConstructorInjectionPointWrapper<T>(bean, type.getJavaClass(), constructorForEnhancedSubclass, originalConstructor, manager); this.componentClassConstructor = originalConstructor.getAnnotated().getJavaMember(); }
public AnnotatedConstructorImpl(AnnotatedConstructor<T> constructor, AnnotatedType<T> declaringType) { this(constructor.getBaseType(), constructor.getTypeClosure(), constructor.getAnnotations(), declaringType, constructor.getJavaMember(), constructor.isStatic()); }
public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) { return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName() + Formats.formatAsFormalParameterList(constructor.getParameters()); }