jakarta.faces.render.FacesBehaviorRenderer Maven / Gradle / Ivy
Show all versions of jakarta.faces Show documentation
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package jakarta.faces.render;
import static jakarta.faces.render.RenderKitFactory.HTML_BASIC_RENDER_KIT;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
*
* The presence of this annotation on a class automatically registers the class with the runtime as a {@link ClientBehaviorRenderer}.
*
* The value of the {@link #renderKitId} attribute is taken to be the render-kit-id to which an instance of this
* Renderer
is to be added.
*
* There must be a public zero-argument constructor on any class where this annotation appears. The implementation must indicate a fatal error
* if such a constructor does not exist and the application must not be placed in service.
*
* Within that {@link RenderKit}, the value of the {@link #rendererType} attribute is taken to be the renderer-type
*
* The implementation must guarantee that for each class annotated with FacesBehaviorRenderer
, found with the
* algorithm in
* section 11.4 "Annotations that correspond to and may take the place of entries in the Application Configuration Resources" of the Jakarta Faces Specification Document,
* the following actions are taken.
*
*
*
*
*
* -
*
* Obtain a reference to the {@link RenderKitFactory} for this application.
*
*
*
* -
*
* See if a RenderKit
exists for render-kit-id. If so, let that instance be renderKit for
* discussion. If not, the implementation must indicate a fatal error if such a RenderKit
does not exist
* and the application must not be placed in service.
*
*
*
* -
*
* Create an instance of this class using the public zero-argument constructor.
*
*
*
* -
*
* Call {@link RenderKit#addClientBehaviorRenderer} on renderKit, passing type as the first argument,
* and a {@link ClientBehaviorRenderer} instance as the second argument.
*
*
*
*
*
*
*
* @since 2.0
*
*/
@Retention(RUNTIME)
@Target(TYPE)
@Inherited
public @interface FacesBehaviorRenderer {
/**
*
* The value of this annotation attribute is taken to be the render-kit-id in which an instance of this class
* of Renderer
must be installed.
*
*
* @since 2.0
*
* @return the render-kit-id
*/
String renderKitId() default HTML_BASIC_RENDER_KIT;
/**
* Within the {@link RenderKit}, the value of this annotation attribute is
* taken to be the renderer-type
*
* @return the renderer-type
*/
String rendererType();
}