@Override public List<AnnotatedParameter> getParameters() { final List<AnnotatedParameter> parameters = new ArrayList<>(ctor.getParameters().size()); for (final AnnotatedParameter<?> ap : ctor.getParameters()) { parameters.add(new AnnotatedParameter() {
public AnnotatedConstructorWrapper(AnnotatedConstructor<X> delegate, AnnotatedTypeWrapper<X> declaringType, boolean keepOriginalAnnotations, Annotation... annotations) { super(delegate, declaringType, keepOriginalAnnotations, annotations); this.delegate = delegate; this.parameters =delegate.getParameters(); }
@Override public Set<AnnotatedConstructor<Market>> getConstructors() { Set<AnnotatedConstructor<Market>> constructors = new HashSet<AnnotatedConstructor<Market>>(); for (AnnotatedConstructor<Market> constructor : super.getConstructors()) { if (constructor.getParameters().size() == 1) { constructors.add(wrapConstructor(constructor, true, Any.Literal.INSTANCE)); } else { constructors.add(constructor); } } return constructors; }
public void checkDefaultConstructor() { for (AnnotatedConstructor<T> constructor: annotatedType.getConstructors()) { if (constructor.getParameters().isEmpty()) { return; } } throw new WebBeansConfigurationException("@Interceptors interceptor must have no-arg constructor, but " + annotatedType.getJavaClass() + " has not"); }
public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) { for (AnnotatedConstructor<?> constructor : type.getConstructors()) { if (constructor.getParameters().isEmpty()) { return true; } if (constructor.isAnnotationPresent(Inject.class)) { return true; } } return false; }
public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) { for (AnnotatedConstructor<?> constructor : type.getConstructors()) { if (constructor.getParameters().isEmpty()) { return true; } if (constructor.isAnnotationPresent(Inject.class)) { return true; } } return false; }
public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) { for (AnnotatedConstructor<?> constructor : type.getConstructors()) { if (constructor.getParameters().isEmpty()) { return true; } if (constructor.isAnnotationPresent(Inject.class)) { return true; } } return false; }
@Test @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "bba") public void configuratorInitializedWithOriginalAT() { AnnotatedType<Cat> catAT = getCurrentManager().getExtension(ProcessAnnotatedTypeObserver.class).getOriginalCatAT(); assertTrue(catAT.isAnnotationPresent(RequestScoped.class)); AnnotatedConstructor<Cat> annotatedConstructor = catAT.getConstructors().stream() .filter(ac -> ac.getParameters().size() == 1 && ac.getParameters().get(0).getBaseType().equals(Feed.class)).findFirst().get(); assertTrue(annotatedConstructor.getParameters().iterator().next().isAnnotationPresent(Cats.class)); assertTrue(annotatedConstructor.isAnnotationPresent(Inject.class)); }
public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) { for (AnnotatedConstructor<?> constructor : type.getConstructors()) { if (constructor.getParameters().isEmpty()) { return true; } if (constructor.isAnnotationPresent(Inject.class)) { return true; } } return false; }
public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) { for (AnnotatedConstructor<?> constructor : type.getConstructors()) { if (constructor.getParameters().isEmpty()) { return true; } if (constructor.isAnnotationPresent(Inject.class)) { return true; } } return false; }
public <T> AnnotatedConstructor<T> decorate(AnnotatedConstructor<T> constructor) { for (AnnotatedParameter<T> p : constructor.getParameters()) { if (needsDecorating(p)) { return new JmsDestinationConstructorWrapper<T>(constructor); } } return constructor; }
private void validateFilterAnnotatedType(AnnotatedType<TestFilter> type) { assert type.getBaseType().equals(TestFilter.class); assert rawTypeSetMatches(type.getTypeClosure(), TestFilter.class, Filter.class, Object.class); assert type.getFields().size() == 4; assert type.getConstructors().size() == 1; assert type.getConstructors().iterator().next().getParameters().isEmpty(); assert type.getMethods().size() == 4; }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
public <T> void collect(@Observes ProcessManagedBean<T> event) { for (AnnotatedField<?> field : event.getAnnotatedBeanClass().getFields()) { addAnnotatedTypeIfNecessary(field); } for (AnnotatedConstructor<?> constructor : event.getAnnotatedBeanClass().getConstructors()) { for (AnnotatedParameter<?> parameter : constructor.getParameters()) { addAnnotatedTypeIfNecessary(parameter); } } }
public AnnotatedConstructorImpl(WebBeansContext webBeansContext, AnnotatedConstructor<X> annotatedConstructor, AnnotatedType<X> declaringType) { super(webBeansContext, annotatedConstructor.getBaseType(), annotatedConstructor.getJavaMember(), declaringType); getAnnotations().addAll(annotatedConstructor.getAnnotations()); for (AnnotatedParameter<X> annotatedParameter : annotatedConstructor.getParameters()) { getParameters().add(new AnnotatedParameterImpl<>(webBeansContext, annotatedParameter.getBaseType(), this, annotatedParameter.getPosition())); } }