jakarta.faces.render.RenderKit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of myfaces-api Show documentation
Show all versions of myfaces-api Show documentation
The public API classes of the Apache MyFaces CORE JSF-2.1 project
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package jakarta.faces.render;
import java.io.OutputStream;
import java.io.Writer;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import jakarta.faces.context.ResponseStream;
import jakarta.faces.context.ResponseWriter;
import org.apache.myfaces.core.api.shared.lang.Assert;
/**
* see Javadoc of Faces Specification
*/
public abstract class RenderKit
{
private HashMap clientBehaviorRenderers;
public RenderKit()
{
this.clientBehaviorRenderers = new HashMap<>();
}
public void addClientBehaviorRenderer(String type, ClientBehaviorRenderer renderer)
{
Assert.notNull(type, "type");
Assert.notNull(renderer, "renderer");
this.clientBehaviorRenderers.put(type, renderer);
}
public abstract void addRenderer(String family, String rendererType, Renderer renderer);
public abstract ResponseStream createResponseStream(OutputStream out);
public abstract ResponseWriter createResponseWriter(Writer writer, String contentTypeList,
String characterEncoding);
public ClientBehaviorRenderer getClientBehaviorRenderer(String type)
{
Assert.notNull(type, "type");
return this.clientBehaviorRenderers.get(type);
}
public Iterator getClientBehaviorRendererTypes()
{
return this.clientBehaviorRenderers.keySet().iterator();
}
/**
*
* Return an Iterator
over the component-family entries supported by this RenderKit
* instance.
*
*
*
* The default implementation of this method returns an empty Iterator
*
*
* @return an iterator over the component families supported by this RenderKit
.
*
* @since 2.0
*/
public Iterator getComponentFamilies()
{
List emptyList = Collections.emptyList();
return emptyList.iterator();
}
public abstract Renderer getRenderer(String family, String rendererType);
/**
*
* Return an Iterator
over the renderer-type entries for the given component-family.
*
*
*
* If the specified componentFamily
is not known to this RenderKit
implementation, return
* an empty Iterator
*
*
*
* The default implementation of this method returns an empty Iterator
*
*
* @param componentFamily
* one of the members of the Iterator
returned by {@link #getComponentFamilies()}
*
* @return an iterator over the renderer-type entries for the given component-family.
*
* @since 2.0
*/
public Iterator getRendererTypes(String componentFamily)
{
List emptyList = Collections.emptyList();
return emptyList.iterator();
}
public abstract ResponseStateManager getResponseStateManager();
}