Skip to content

Package: FormAuthenticationMechanismDefinition$FormAuthenticationMechanism$Literal

FormAuthenticationMechanismDefinition$FormAuthenticationMechanism$Literal

nameinstructionbranchcomplexitylinemethod
FormAuthenticationMechanismDefinition.FormAuthenticationMechanism.Literal()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2024 Contributors to Eclipse Foundation.
3: * Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package jakarta.security.enterprise.authentication.mechanism.http;
19:
20: import static java.lang.annotation.ElementType.FIELD;
21: import static java.lang.annotation.ElementType.METHOD;
22: import static java.lang.annotation.ElementType.PARAMETER;
23: import static java.lang.annotation.ElementType.TYPE;
24: import static java.lang.annotation.RetentionPolicy.RUNTIME;
25:
26: import jakarta.enterprise.util.AnnotationLiteral;
27: import jakarta.enterprise.util.Nonbinding;
28: import jakarta.inject.Qualifier;
29: import java.lang.annotation.Repeatable;
30: import java.lang.annotation.Retention;
31: import java.lang.annotation.Target;
32:
33: /**
34: * Annotation used to define a container authentication mechanism that implements
35: * FORM authentication as defined by the Servlet spec (13.6.3) and make that
36: * implementation available as an enabled CDI bean.
37: *
38: */
39: @Retention(RUNTIME)
40: @Target(TYPE)
41: @Repeatable(FormAuthenticationMechanismDefinition.List.class)
42: public @interface FormAuthenticationMechanismDefinition {
43:
44: @Nonbinding
45: LoginToContinue loginToContinue();
46:
47: /**
48: * List of {@link Qualifier qualifier annotations}.
49: *
50: * <p>
51: * An {@link HttpAuthenticationMechanism} injection point
52: * with these qualifier annotations injects a bean that is
53: * produced by this {@code FormAuthenticationMechanismDefinition}.</p>
54: *
55: * <p>
56: * The default value is {@code FormAuthenticationMechanism}, indicating that
57: * this {@code FormAuthenticationMechanismDefinition} produces
58: * bean instances of type {@link HttpAuthenticationMechanism} qualified by
59: * {@code FormAuthenticationMechanism}.
60: *
61: * @return list of qualifiers.
62: * @since 4.0
63: */
64: Class<?>[] qualifiers() default { FormAuthenticationMechanism.class };
65:
66: /**
67: * Enables multiple <code>FormAuthenticationMechanismDefinition</code>
68: * annotations on the same type.
69: */
70: @Retention(RUNTIME)
71: @Target(TYPE)
72: public @interface List {
73: FormAuthenticationMechanismDefinition[] value();
74: }
75:
76: @Qualifier
77: @Retention(RUNTIME)
78: @Target({FIELD, METHOD, TYPE, PARAMETER})
79: public static @interface FormAuthenticationMechanism {
80:
81: /**
82: * Supports inline instantiation of the {@link FormAuthenticationMechanism} qualifier.
83: *
84: * @since 4.0
85: */
86: public static final class Literal extends AnnotationLiteral<FormAuthenticationMechanism> implements FormAuthenticationMechanism {
87: private static final long serialVersionUID = 1L;
88:
89: /**
90: * Instance of the {@link FormAuthenticationMechanism} qualifier.
91: */
92: public static final Literal INSTANCE = new Literal();
93: }
94:
95: }
96:
97: }