com.sun.faces.renderkit.html_basic
Class HtmlBasicRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
Direct Known Subclasses:
ButtonRenderer, FormRenderer, GridRenderer, GroupRenderer, HtmlBasicInputRenderer, ImageRenderer, LinkRenderer, MessageRenderer, MessagesRenderer, OutputMessageRenderer, TableRenderer

public abstract class HtmlBasicRenderer
extends javax.faces.render.Renderer

HtmlBasicRenderer is a base class for implementing renderers for HtmlBasicRenderKit.


Nested Class Summary
static class HtmlBasicRenderer.Param
          Simple class to encapsulate the name and value of a UIParameeter.
 
Field Summary
protected static java.util.logging.Logger logger
           
 
Constructor Summary
HtmlBasicRenderer()
           
 
Method Summary
 void addGenericErrorMessage(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String messageId, java.lang.String param)
           
protected  java.lang.String augmentIdReference(javax.faces.context.FacesContext context, java.lang.String forValue, javax.faces.component.UIComponent fromComponent)
          Conditionally augment an id-reference value.
 java.lang.String convertClientId(javax.faces.context.FacesContext context, java.lang.String clientId)
           
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  void encodeRecursive(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Render nested child components by invoking the encode methods on those components, but only when the rendered property is true.
protected  java.util.Iterator<javax.faces.component.UIComponent> getChildren(javax.faces.component.UIComponent component)
          Return an Iterator over the children of the specified component, selecting only those that have a rendered property of true.
protected  java.lang.String getCurrentValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Gets value to be rendered and formats it if required.
protected  void getEndTextToRender(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String currentValue)
          Renderers override this method to write appropriate HTML content into the buffer.
protected  javax.faces.component.UIComponent getFacet(javax.faces.component.UIComponent component, java.lang.String name)
          Return the specified facet from the specified component, but only if its rendered property is set to true.
protected  javax.faces.component.UIComponent getForComponent(javax.faces.context.FacesContext context, java.lang.String forComponent, javax.faces.component.UIComponent component)
          Locates the component identified by forComponent
protected  java.lang.String getFormattedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object currentValue)
          Renderers override this method in case output value needs to be formatted
protected  java.util.Iterator getMessageIter(javax.faces.context.FacesContext context, java.lang.String forComponent, javax.faces.component.UIComponent component)
           
protected  HtmlBasicRenderer.Param[] getParamList(javax.faces.component.UIComponent command)
           
 boolean getRendersChildren()
           
protected  java.lang.Object getValue(javax.faces.component.UIComponent component)
           
protected  void setSubmittedValue(javax.faces.component.UIComponent component, java.lang.Object value)
          Renderers override this method to store the previous value of the associated component.
protected  boolean shouldWriteIdAttribute(javax.faces.component.UIComponent component)
           
protected  java.lang.String writeIdAttributeIfNecessary(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component)
           
 
Methods inherited from class javax.faces.render.Renderer
encodeBegin, encodeChildren, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger
Constructor Detail

HtmlBasicRenderer

public HtmlBasicRenderer()
Method Detail

addGenericErrorMessage

public void addGenericErrorMessage(javax.faces.context.FacesContext facesContext,
                                   javax.faces.component.UIComponent component,
                                   java.lang.String messageId,
                                   java.lang.String param)

convertClientId

public java.lang.String convertClientId(javax.faces.context.FacesContext context,
                                        java.lang.String clientId)
Overrides:
convertClientId in class javax.faces.render.Renderer

decode

public void decode(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)
Overrides:
decode in class javax.faces.render.Renderer

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)
               throws java.io.IOException
Overrides:
encodeEnd in class javax.faces.render.Renderer
Throws:
java.io.IOException

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.render.Renderer

augmentIdReference

protected java.lang.String augmentIdReference(javax.faces.context.FacesContext context,
                                              java.lang.String forValue,
                                              javax.faces.component.UIComponent fromComponent)

Conditionally augment an id-reference value.

If the forValue doesn't already include a generated suffix, but the id of the fromComponent does include a generated suffix, then append the suffix from the fromComponent to the forValue. Otherwise just return the forValue as is.

Parameters:
forValue - - the basic id-reference value.
fromComponent - - the component that holds the code>forValue.
Returns:
the (possibly augmented) forValue.

encodeRecursive

protected void encodeRecursive(javax.faces.context.FacesContext context,
                               javax.faces.component.UIComponent component)
                        throws java.io.IOException

Render nested child components by invoking the encode methods on those components, but only when the rendered property is true.

Throws:
java.io.IOException

getChildren

protected java.util.Iterator<javax.faces.component.UIComponent> getChildren(javax.faces.component.UIComponent component)

Return an Iterator over the children of the specified component, selecting only those that have a rendered property of true.

Parameters:
component - UIComponent for which to extract children

getCurrentValue

protected java.lang.String getCurrentValue(javax.faces.context.FacesContext context,
                                           javax.faces.component.UIComponent component)
Gets value to be rendered and formats it if required. Sets to empty string if value is null.


getEndTextToRender

protected void getEndTextToRender(javax.faces.context.FacesContext context,
                                  javax.faces.component.UIComponent component,
                                  java.lang.String currentValue)
                           throws java.io.IOException
Renderers override this method to write appropriate HTML content into the buffer.

Throws:
java.io.IOException

getFacet

protected javax.faces.component.UIComponent getFacet(javax.faces.component.UIComponent component,
                                                     java.lang.String name)

Return the specified facet from the specified component, but only if its rendered property is set to true.

Parameters:
component - Component from which to return a facet
name - Name of the desired facet

getForComponent

protected javax.faces.component.UIComponent getForComponent(javax.faces.context.FacesContext context,
                                                            java.lang.String forComponent,
                                                            javax.faces.component.UIComponent component)
Locates the component identified by forComponent

Parameters:
forComponent - - the component to search for
component - - the starting point in which to begin the search
Returns:
the component with the the idforComponent otheriwse null if no match is found.

getFormattedValue

protected java.lang.String getFormattedValue(javax.faces.context.FacesContext context,
                                             javax.faces.component.UIComponent component,
                                             java.lang.Object currentValue)
                                      throws javax.faces.convert.ConverterException
Renderers override this method in case output value needs to be formatted

Throws:
javax.faces.convert.ConverterException

getMessageIter

protected java.util.Iterator getMessageIter(javax.faces.context.FacesContext context,
                                            java.lang.String forComponent,
                                            javax.faces.component.UIComponent component)

getParamList

protected HtmlBasicRenderer.Param[] getParamList(javax.faces.component.UIComponent command)
Parameters:
command - the command which may have parameters
Returns:
an array of parameters

getValue

protected java.lang.Object getValue(javax.faces.component.UIComponent component)

setSubmittedValue

protected void setSubmittedValue(javax.faces.component.UIComponent component,
                                 java.lang.Object value)
Renderers override this method to store the previous value of the associated component.


shouldWriteIdAttribute

protected boolean shouldWriteIdAttribute(javax.faces.component.UIComponent component)
Returns:
true if this renderer should render an id attribute.

writeIdAttributeIfNecessary

protected java.lang.String writeIdAttributeIfNecessary(javax.faces.context.FacesContext context,
                                                       javax.faces.context.ResponseWriter writer,
                                                       javax.faces.component.UIComponent component)


Copyright ? 2002-2006 Sun Microsystems, Inc. All Rights Reserved.