Keel 2.1RC2

org.keel.faces.renderkit.xml
Class XMLRenderer

java.lang.Object
  extended byRenderer
      extended byorg.keel.faces.renderkit.xml.XMLRenderer
Direct Known Subclasses:
CommandRenderer, DataRenderer, InputRenderer, OutputRenderer, PanelRenderer, XMLRootRenderer

public abstract class XMLRenderer
extends Renderer

RenderKit to "render" UIComponents into an XML DOM document. Used by UI frameworks that digest XML instead of going directly to HTML/JSP/etc. The "real" rendering to the finished HTML (WML, etc) is done by the front-end framework in this case (e.g. via XSL in Cocoon).

Author:
Michael Nash
See Also:
Serialized Form

Field Summary
private static int count
           
static java.lang.String ELEMENT_KEY
           
static java.lang.String XML_ELEMENT_KEY
           
 
Constructor Summary
XMLRenderer()
           
 
Method Summary
protected  java.lang.String computeTypeString(UIComponent component)
          Determine the component type based on the classname of the component itself (e.g.
protected  org.w3c.dom.Element createValidNameElement(FacesContext fc, java.lang.String name)
          Special wrapper around createElement to ensure we don't try to create an element with an invalid name.
 void decode(FacesContext fc, UIComponent component)
           
 void encodeBegin(FacesContext fc, UIComponent component)
           
 void encodeChildren(FacesContext fc, UIComponent parent)
           
protected  org.w3c.dom.Element getRoot(FacesContext fc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ELEMENT_KEY

public static final java.lang.String XML_ELEMENT_KEY
See Also:
Constant Field Values

ELEMENT_KEY

public static final java.lang.String ELEMENT_KEY
See Also:
Constant Field Values

count

private static int count
Constructor Detail

XMLRenderer

public XMLRenderer()
Method Detail

decode

public void decode(FacesContext fc,
                   UIComponent component)

getRoot

protected org.w3c.dom.Element getRoot(FacesContext fc)

encodeBegin

public void encodeBegin(FacesContext fc,
                        UIComponent component)
                 throws java.io.IOException
Throws:
java.io.IOException

encodeChildren

public void encodeChildren(FacesContext fc,
                           UIComponent parent)
                    throws java.io.IOException
Throws:
java.io.IOException

createValidNameElement

protected org.w3c.dom.Element createValidNameElement(FacesContext fc,
                                                     java.lang.String name)
Special wrapper around createElement to ensure we don't try to create an element with an invalid name. If so, use a temporary name and warn.

Parameters:
name -
Returns:
Element

computeTypeString

protected java.lang.String computeTypeString(UIComponent component)
                                      throws java.io.IOException
Determine the component type based on the classname of the component itself (e.g. just hack off the package, really). We don't just manipulate the string in the event we want to map a given component to a different type at some point - e.g. a many-to-one mapping, for example, where more than one class is just a different sort of the same component. TODO: Probably/perhaps want to make this more configurable...

Parameters:
component - The UIComponent to determine the type of
Returns:
A string name for the Type of this UIComponent
Throws:
java.io.IOException - If the component type is unknown or unsupported. Better thing to do here would be to revert to the "hack off the package name" method instead of choking...

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.