use of jakarta.enterprise.inject.spi.Annotated in project cdi by eclipse-ee4j.
the class AbstractAnnotatedTest method shouldFindAnnotationsOnAnnotated.
@Test
public void shouldFindAnnotationsOnAnnotated() {
Annotated annotated = getAnnotated();
Set<Repeater> repeaters = annotated.getAnnotations(Repeater.class);
Assert.assertEquals(repeaters, new LinkedHashSet<>(asList(getAnnotationsByType(Repeater.class))));
}
use of jakarta.enterprise.inject.spi.Annotated in project cdi by eclipse-ee4j.
the class AbstractAnnotatedTest method shouldReturnSingletonForNonRepeatableAnnotation.
@Test
public void shouldReturnSingletonForNonRepeatableAnnotation() {
Annotated annotated = getAnnotated();
Set<Repeaters> repeaters = annotated.getAnnotations(Repeaters.class);
Assert.assertEquals(repeaters, Collections.singleton(getAnnotation(Repeaters.class)));
}
use of jakarta.enterprise.inject.spi.Annotated in project myfaces by apache.
the class FacesDataModelExtension method collect.
public <T> void collect(@Observes ProcessManagedBean<T> event) {
Annotated annotated = event.getAnnotatedBeanClass();
if (annotated.isAnnotationPresent(FacesDataModel.class)) {
FacesDataModel model = (FacesDataModel) annotated.getAnnotation(FacesDataModel.class);
boolean hasValue = model.forClass() != null;
if (hasValue) {
types.add(new FacesDataModelInfo(annotated.getBaseType(), model.forClass()));
}
}
}
use of jakarta.enterprise.inject.spi.Annotated in project helidon by oracle.
the class HikariCPBackedDataSourceExtension method processAnnotatedType.
private void processAnnotatedType(@Observes @WithAnnotations({ DataSourceDefinition.class, DataSourceDefinitions.class }) final ProcessAnnotatedType<?> event) {
if (event != null) {
final Annotated annotated = event.getAnnotatedType();
if (annotated != null) {
final Set<? extends DataSourceDefinition> dataSourceDefinitions = annotated.getAnnotations(DataSourceDefinition.class);
if (dataSourceDefinitions != null && !dataSourceDefinitions.isEmpty()) {
for (final DataSourceDefinition dsd : dataSourceDefinitions) {
assert dsd != null;
final Set<String> knownDataSourceNames = this.getDataSourceNames();
assert knownDataSourceNames != null;
final String dataSourceName = dsd.name();
if (!knownDataSourceNames.contains(dataSourceName)) {
final Entry<? extends String, ? extends Properties> entry = toProperties(dsd);
if (entry != null) {
this.putDataSourceProperties(dataSourceName, entry.getValue());
}
}
}
}
}
}
}
use of jakarta.enterprise.inject.spi.Annotated in project helidon by oracle.
the class OciCdiExtension method updateInjectionPoints.
/**
* Add internal qualifier.
*
* @param event CDI event
*/
void updateInjectionPoints(@Observes ProcessInjectionPoint<?, ?> event) {
InjectionPoint injectionPoint = event.getInjectionPoint();
Annotated annotated = injectionPoint.getAnnotated();
Type type = injectionPoint.getType();
if (supportedTypes.contains(type)) {
Named name = annotated.getAnnotation(Named.class);
OciInternal internal = OciInternal.Literal.create((name == null ? "" : name.value()));
event.configureInjectionPoint().addQualifier(internal);
}
}
Aggregations