net.sourceforge.smile.util
Class RenderUtil

java.lang.Object
  extended bynet.sourceforge.smile.util.RenderUtil

public class RenderUtil
extends java.lang.Object

Utility class used for rendering


Constructor Summary
RenderUtil()
           
 
Method Summary
static java.lang.Boolean getBooleanAttribute(javax.faces.component.UIComponent component, java.lang.String attribute)
          This operation is a convenience helper that checks the type safety for the attributes of type Boolean.This operation throws an appropriate exception, or returns a primitive boolean for a given attribute.
static javax.faces.component.UIForm getEnclosingForm(javax.faces.component.UIComponent component)
          Looks for the closest UIForm ancestor component.
static java.lang.Long getNumericAttribute(javax.faces.component.UIComponent component, java.lang.String attribute)
          This operation retrieves a numeric attribute.
static java.lang.String getStringAttribute(javax.faces.component.UIComponent component, java.lang.String attribute)
          This operation is a convenience helper that checks the type safety for the attributes of type String.This operation throws an appropriate exception, or returns the down-casted string for a given attribute.
static java.lang.String[] getStringListAttribute(javax.faces.component.UIComponent component, java.lang.String attribute)
          Retrieves a string list attribute from a specified component.
static void renderBooleanPassthruAttributes(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static void renderEventHandlerPassthruAttributes(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static void renderPassthruAttributes(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderUtil

public RenderUtil()
Method Detail

renderBooleanPassthruAttributes

public static void renderBooleanPassthruAttributes(javax.faces.context.FacesContext context,
                                                   javax.faces.component.UIComponent component)
                                            throws java.io.IOException
Throws:
java.io.IOException

renderPassthruAttributes

public static void renderPassthruAttributes(javax.faces.context.FacesContext context,
                                            javax.faces.component.UIComponent component)
                                     throws java.io.IOException
Throws:
java.io.IOException

renderEventHandlerPassthruAttributes

public static void renderEventHandlerPassthruAttributes(javax.faces.context.FacesContext context,
                                                        javax.faces.component.UIComponent component)
                                                 throws java.io.IOException
Throws:
java.io.IOException

getStringAttribute

public static java.lang.String getStringAttribute(javax.faces.component.UIComponent component,
                                                  java.lang.String attribute)
This operation is a convenience helper that checks the type safety for the attributes of type String.This operation throws an appropriate exception, or returns the down-casted string for a given attribute.

Parameters:
component - the component to query for the attribute.
attribute - the attribute to query for.
Returns:
The string value for the attribute, or null if attribute not present.
Throws:
java.lang.IllegalArgumentException - when the requested attribute turns out to be of a different type than java.lang.String.

getBooleanAttribute

public static java.lang.Boolean getBooleanAttribute(javax.faces.component.UIComponent component,
                                                    java.lang.String attribute)
This operation is a convenience helper that checks the type safety for the attributes of type Boolean.This operation throws an appropriate exception, or returns a primitive boolean for a given attribute.

Parameters:
component - the component to query for the attribute.
attribute - the attribute to query for.
Returns:
The string value for the attribute.
Throws:
java.lang.IllegalArgumentException - when the requested attribute turns out to be of a different type than java.lang.Boolean.

getNumericAttribute

public static java.lang.Long getNumericAttribute(javax.faces.component.UIComponent component,
                                                 java.lang.String attribute)
This operation retrieves a numeric attribute. It checks and converts the attribute into a Long, which provides for convenient access to the attribute. It also throws an IllegalArgumentException when the attribute is not of the requested type.

Parameters:
component - the component to check.
attribute - the attribute to look up.
Returns:
a long with the value or null if the attribute is not specified for the component.

getStringListAttribute

public static java.lang.String[] getStringListAttribute(javax.faces.component.UIComponent component,
                                                        java.lang.String attribute)
Retrieves a string list attribute from a specified component. This operation is useful to find and retrieve an attribute which is described in to have a comma separated list of elements. The individual elements are returned (in order) as a array of strings of easy interpretation. If the attribute is not available a null value is returned.

Parameters:
component - the component on which to look.
attribute - the attribute to look for.
Returns:
a String[] with the individual values or null if the attribute is not set on the component.

getEnclosingForm

public static javax.faces.component.UIForm getEnclosingForm(javax.faces.component.UIComponent component)
Looks for the closest UIForm ancestor component.

Parameters:
component -
Returns:
a UIForm or null if there is no enclosing UIForm available