javax.faces.render.FacesRenderer Maven / Gradle / Ivy
Show all versions of jakarta.faces Show documentation
/*
* Copyright (c) 1997, 2018 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 javax.faces.render;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.Inherited;
/**
* The presence of this annotation on a
* class automatically registers the class with the runtime as a {@link
* Renderer}. 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, and the value of
* the {@link #componentFamily} attribute is to be taken as the
* component-family. The implementation must guarantee that
* for each class annotated with FacesRenderer
, found with
* the algorithm in section JSF.11.5,
* 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#addRenderer} on
renderKit, passing component-family as the
first argument, renderer-type as the second, and the
newly instantiated RenderKit
instance as the
third argument.
*
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface FacesRenderer {
/**
* 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.
*
* @return the render-kit-id
*/
String renderKitId() default RenderKitFactory.HTML_BASIC_RENDER_KIT;
/**
* The value of this annotation
* attribute is taken to be the renderer-type which, in
* combination with {@link #componentFamily} can be used to obtain a
* reference to an instance of this {@link Renderer} by calling
* {@link javax.faces.render.RenderKit#getRenderer(java.lang.String,
* java.lang.String)}.
*
* @return the renderer-type
*/
String rendererType();
/**
* The value of this annotation
* attribute is taken to be the component-family which, in
* combination with {@link #rendererType} can be used to obtain a
* reference to an instance of this {@link Renderer} by calling
* {@link javax.faces.render.RenderKit#getRenderer(java.lang.String,
* java.lang.String)}.
*
* @return the component-family
*/
String componentFamily();
}