Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing annotation literals #1582

Closed
BalusC opened this issue Sep 6, 2021 · 5 comments
Closed

Add missing annotation literals #1582

BalusC opened this issue Sep 6, 2021 · 5 comments
Assignees
Labels
mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces
Milestone

Comments

@BalusC
Copy link
Member

BalusC commented Sep 6, 2021

Make sure that all @Qualifier @Retention(RUNTIME) public @interface Xyz {} annotation classes in the jakarta.faces package have a corresponding AnnotationLiteral implementation provided by the API.

The pattern is:

With parameters:

@Qualifier
@Retention(RUNTIME)
public @interface Xyz {

    String foo() default "";
    String bar() default "bla";

    /**
     * <p class="changed_added_4_0">
     * Supports inline instantiation of the {@link Xyz} annotation.
     * </p>
     * 
     * @since 4.0
     */
    public static final class Literal extends AnnotationLiteral<Xyz> implements Xyz {

        private static final long serialVersionUID = 1L;

        public static final Literal INSTANCE = of("", "bla");

        private final String foo;
        private final String bar;

        public static Literal of(String foo, String bar) {
            return new Literal(foo, bar);
        }

        private Literal(String foo, String bar) {
            this.foo = foo;
            this.bar = bar;
        }

        @Override
        public String foo() {
            return foo;
        }

        @Override
        public String bar() {
            return bar;
        }
    }
}

Without parameters:

@Qualifier
@Retention(RUNTIME)
@Target({ TYPE, METHOD, FIELD, PARAMETER })
@Documented
public @interface Xyz {
  
    public static final class Literal extends AnnotationLiteral<Any> implements Xyz {
        private static final long serialVersionUID = 1L;
        public static final Literal INSTANCE = new Literal();
    }
}
@arjantijms arjantijms added this to the 4.0 milestone Sep 6, 2021
@arjantijms arjantijms added the 4.0 label Sep 6, 2021
@arjantijms arjantijms self-assigned this Sep 9, 2021
@arjantijms
Copy link
Contributor

Provided implementation for Mojarra here: eclipse-ee4j/mojarra#4963

@arjantijms arjantijms added the mojarra-implemented API issue implemented by Mojarra label Sep 13, 2021
@tandraschko
Copy link

also implemented in myfaces

@arjantijms arjantijms added the myfaces-implemented API issue implemented by MyFaces label Sep 14, 2021
@arjantijms
Copy link
Contributor

also implemented in myfaces

Thanks!

@BalusC
Copy link
Member Author

BalusC commented Dec 9, 2021

@arjantijms please reopen; during spec verification and cleanup I noticed literals are missing for following qualifiers (which are not in annotation subpackage):

  • @FacesBehavior
  • @FacesConverter
  • @FacesDataModel
  • @FacesValidator
  • @FlowBuilderParameter
  • @FlowDefinition
  • @Push
  • @WebsocketEvent.Closed
  • @WebsocketEvent.Opened

And I also noticed @RequestCookieMap and @SessionMap have an unspecified copy in jakarta.faces.context package (they already exist in jakarta.faces.annotation package). Those apparent accidental copies should be removed or at least be deprecated.

BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Dec 9, 2021
Add missing annotation literals for remaining qualifiers not in
annotation subpackage
@BalusC
Copy link
Member Author

BalusC commented Dec 9, 2021

As confirmed with Arjan, unspecified copies of @RequestCookieMap and @SessionMap in jakarta.faces.context package have been removed.

BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Dec 9, 2021
Add more missing annotation literals for qualifiers
BalusC pushed a commit that referenced this issue Feb 10, 2024
Signed-off-by: arjantijms <arjan.tijms@gmail.com>
BalusC pushed a commit that referenced this issue Feb 10, 2024
…erals

#1582 Implement spec issue 1582 - Add missing annotation literals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces
Projects
None yet
Development

No branches or pull requests

3 participants