The default implementation of this method extracts this information from an invocation of the {@link - * #eventDependency()} method ({@linkplain #eventDependency() q.v.}).
- * - * @return a non-{@code null}, determinate {@link AttributedType} - * - * @exception NullPointerException if the default implementation of this method receives a {@code null} return value - * from an invocation of the {@link #eventDependency()} method - * - * @see #eventDependency() - */ - @Override // AttributedTypedAggregate (AttributedTyped) - public default AttributedType attributedType() { - return this.eventDependency().attributedType(); - } - - /** - * Returns a non-{@code null}, determinate, immutable {@link SequencedSet} of {@link AttributedElement}s representing + * Returns a non-{@code null}, determinate, immutable {@link SequencedSet} of {@link Element}s representing * dependencies this {@link EventListener} has that must be resolved before any invocation of the {@link - * #eventReceived(Object, ReferencesSelector)} method may properly occur. + * #eventReceived(Object, ReferencesSelector2)} method may properly occur. * *Implementations of this method must not include a result of any invocation of the {@link #eventDependency()} * method as an element of the return value.
@@ -89,38 +67,35 @@ public default AttributedType attributedType() { *The default implementation of this method returns an {@linkplain SequencedSet#isEmpty() empty} {@link * SequencedSet}. Overrides are expected.
* - * @return a non-{@code null}, determinate, immutable {@link SequencedSet} of {@link AttributedElement}s + * @return a non-{@code null}, determinate, immutable {@link SequencedSet} of {@link Element}s * - * @see #eventReceived(Object, ReferencesSelector) + * @see #eventReceived(Object, ReferencesSelector2) * * @see #eventDependency() */ // Returns dependencies that are not the event dependency. These are resolved by the system. Think of an observer // method with an observed parameter and other parameters. The other parameters are these dependencies. - @Override // AttributedTypedAggregate (Aggregate) - public default SequencedSetThe result of an invocation of this method must not appear as an element of the return value of an invocation of * the {@link #dependencies()} method.
* - *Note that the default implementation of the {@link #attributedType()} method calls this method and requires it - * to return a non-{@code null} value.
- * - * @return a non-{@code null}, determinate {@link AttributedElement} + * @return a non-{@code null}, determinate {@link Element} * * @see #dependencies() */ - // An AttributedElement describing the event event "slot" (the observed parameter). + // An Element describing the event event "slot" (the observed parameter). // Conceptually just another dependency (see dependencies()) but it is supplied by the user, not the system. // Normally a method parameter. // T's argument (the event event type) must be among its types. - public AttributedElement eventDependency(); + public Annotated extends Element> eventDependency(); /** * Receives and handles an event, normally as delivered by an invocation of the {@link Events#fire(TypeMirror, List, diff --git a/src/main/java/org/microbean/event/EventQualifiersMatcher.java b/src/main/java/org/microbean/event/EventQualifiersMatcher.java index bb48d3c..fec896b 100644 --- a/src/main/java/org/microbean/event/EventQualifiersMatcher.java +++ b/src/main/java/org/microbean/event/EventQualifiersMatcher.java @@ -1,6 +1,6 @@ /* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*- * - * Copyright © 2025 microBean™. + * Copyright © 2025–2026 microBean™. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,23 +15,23 @@ import java.util.Collection; +import javax.lang.model.element.AnnotationMirror; + import org.microbean.assign.Matcher; import org.microbean.assign.Qualifiers; -import org.microbean.attributes.Attributes; - import static java.util.Objects.requireNonNull; /** * A {@link Matcher} encapsulating CDI-compatible event + * href="https://jakarta.ee/specifications/cdi/4.1/jakarta-cdi-spec-4.1#observer_resolution">CDI-compatible event * qualifier matching rules. * * @author Laird Nelson * * @see #test(Collection, Collection) */ -public final class EventQualifiersMatcher implements MatcherA suitable {@link EventListener} is one whose {@link EventListener#attributedType()} method returns an {@link
- * AttributedType}
- *
* @param typeArgumentSource handwave here about the specified type and type argument substitution
*
- * @param attributes a {@link List} of {@link Attributes} qualifying the event; must not be {@code null}
+ * @param annotations a {@link List} of {@link AnnotationMirror}s qualifying the event; must not be {@code null}
*
* @param event the event; must not be {@code null}
*
- * @param rs a {@link ReferencesSelector}; used to find {@link EventListener EventListener<?, ?>} references; must not be
- * {@code null}
+ * @param rs a {@link ReferencesSelector}; used to find {@link EventListener EventListener<?, ?>} references;
+ * must not be {@code null}
*
* @exception NullPointerException if any argument is {@code null}
*
@@ -103,21 +108,22 @@ public Events(final EventTypes eventTypes,
*/
// Deliberately final.
public final void fire(final TypeMirror typeArgumentSource,
- final List Overrides of this method must not call the {@link #fire(TypeMirror, List, Object, ReferencesSelector)} method,
* or an infinite loop may result.