/* * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the License). You may not use this file except in * compliance with the License. * * You can obtain a copy of the license at * https://jsftemplating.dev.java.net/cddl1.html or * jsftemplating/cddl1.txt. * See the License for the specific language governing * permissions and limitations under the License. * * When distributing Covered Code, include this CDDL * Header Notice in each file and include the License file * at jsftemplating/cddl1.txt. * If applicable, add the following below the CDDL Header, * with the fields enclosed by brackets [] replaced by * you own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. */ package com.sun.jsftemplating.component.factory.basic; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import com.sun.jsftemplating.annotation.UIComponentFactory; import com.sun.jsftemplating.component.factory.ComponentFactoryBase; import com.sun.jsftemplating.layout.descriptors.LayoutComponent; /** *

This factory is responsible for instantiating a NamingContainer * UIComponent.

* *

The {@link com.sun.jsftemplating.layout.descriptors.ComponentType} * id for this factory is: "namingContainer".

* * @author Ken Paulsen (ken.paulsen@sun.com) */ @UIComponentFactory("namingContainer") public class NamingContainerFactory extends ComponentFactoryBase { /** *

This is the factory method responsible for creating the * UIComponent.

* * @param context The FacesContext * @param descriptor The {@link LayoutComponent} descriptor associated * with the requested UIComponent. * @param parent The parent UIComponent * * @return The newly created NamingContainer. */ public UIComponent create(FacesContext context, LayoutComponent descriptor, UIComponent parent) { // Create the UIComponent UIComponent comp = createComponent(context, COMPONENT_TYPE, descriptor, parent); // Set all the attributes / properties setOptions(context, descriptor, comp); // Return the component return comp; } /** *

The UIComponent type that must be registered in the * faces-config.xml file mapping to the UIComponent class * to use for this UIComponent.

*/ public static final String COMPONENT_TYPE = "com.sun.jsftemplating.NamingContainer"; }