public final class RendererUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DUMMY_FORM_ID |
| Modifier | Constructor and Description |
|---|---|
protected |
RendererUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
attributeValue(String name,
Object value)
Convert attribute value to proper object.
|
String |
clientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Simplified version of
encodeId |
String |
correctForIdReference(String forAttr,
javax.faces.component.UIComponent component)
If target component contains generated id and for doesn't, correct for id
|
Map<String,Object> |
createParametersMap(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
Object |
createParameterValue(javax.faces.component.UIParameter parameter)
Returns value of the parameter.
|
void |
encodeAttribute(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object property,
String attributeName) |
void |
encodeAttribute(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String attribute) |
void |
encodeAttributes(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String attrs)
Encode attributes given by comma-separated string list.
|
void |
encodeAttributesFromArray(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String[] attrs) |
void |
encodeBeginForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.context.ResponseWriter writer,
String clientId) |
void |
encodeBeginFormIfNessesary(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
void |
encodeChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
void |
encodeCustomId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Encode id attribute with clientId component property.
|
void |
encodeEndForm(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer) |
void |
encodeEndFormIfNessesary(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
void |
encodeId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Encode id attribute with clientId component property
|
void |
encodeId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String attribute)
Encode clientId to custom attribute ( for example, to control name )
|
void |
encodePassThru(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String defaultHtmlEvent)
Encode common pass-thru html attributes.
|
void |
encodePassThruAttribute(javax.faces.context.FacesContext context,
Map<String,Object> attributes,
javax.faces.context.ResponseWriter writer,
String attribute)
Encode one pass-thru attribute, with plain/boolean/url value, got from properly component attribute.
|
void |
encodePassThruWithExclusions(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String exclusions,
String defaultHtmlEvent)
Encode pass-through attributes except specified ones
|
void |
encodePassThruWithExclusionsArray(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String[] exclusions,
String defaultHtmlEvent) |
String |
encodePctOrPx(String value)
formats given value to
|
String |
encodePx(String value) |
javax.faces.component.UIComponent |
findComponentFor(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String id) |
javax.faces.component.UIComponent |
findComponentFor(javax.faces.component.UIComponent component,
String id) |
String |
getActionUrl(javax.faces.context.FacesContext facesContext) |
protected Object |
getComponentAttributeName(Object key)
Convert HTML attribute name to component property name.
|
static RendererUtils |
getInstance()
Use this method to get singleton instance of RendererUtils
|
javax.faces.component.UIComponent |
getNestingForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Find nested form for given component
|
boolean |
hasExplicitId(javax.faces.component.UIComponent component) |
boolean |
isBooleanAttribute(javax.faces.component.UIComponent component,
String name)
Get boolean value of logical attribute
|
boolean |
isEmpty(Object o)
Checks if the argument passed in is empty or not.
|
void |
writeScript(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object script)
Wtrie JavaScript with start/end elements and type.
|
static void |
writeState(javax.faces.context.FacesContext context)
Write state saving markers to context, include MyFaces view sequence.
|
public static final String DUMMY_FORM_ID
public static RendererUtils getInstance()
public void encodeId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
context - component - IOExceptionpublic void encodeId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String attribute)
throws IOException
context - component - attribute - IOExceptionpublic void encodeCustomId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
context - component - IOExceptionpublic Object createParameterValue(javax.faces.component.UIParameter parameter)
JavaScriptParameter, NoEcape
attribute is applied.parameter - instance of UIParameterObject parameter valuepublic Map<String,Object> createParametersMap(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public void encodePassThru(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String defaultHtmlEvent)
throws IOException
context - component - IOExceptionpublic void encodePassThruWithExclusions(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String exclusions,
String defaultHtmlEvent)
throws IOException
context - component - exclusions - IOExceptionpublic void encodePassThruWithExclusionsArray(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String[] exclusions,
String defaultHtmlEvent)
throws IOException
IOExceptionpublic void encodePassThruAttribute(javax.faces.context.FacesContext context,
Map<String,Object> attributes,
javax.faces.context.ResponseWriter writer,
String attribute)
throws IOException
context - writer - attribute - IOExceptionpublic void encodeAttributesFromArray(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String[] attrs)
throws IOException
IOExceptionpublic void encodeAttributes(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String attrs)
throws IOException
context - current JSF contextcomponent - for with render attributes valuesattrs - comma separated list of attributesIOExceptionpublic void encodeAttribute(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object property,
String attributeName)
throws IOException
context - component - property - attributeName - IOExceptionpublic void encodeAttribute(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String attribute)
throws IOException
IOExceptionpublic boolean isEmpty(Object o)
nullo - object to check for emptinesstrue if the argument is empty, false otherwiseprotected Object getComponentAttributeName(Object key)
key - protected Object attributeValue(String name, Object value)
name - attribute name.value - public boolean isBooleanAttribute(javax.faces.component.UIComponent component,
String name)
component - name - attribute namepublic String encodePctOrPx(String value)
value - public javax.faces.component.UIComponent getNestingForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
component - UIForm component, or nullpublic void encodeBeginFormIfNessesary(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
context - component - IOExceptionpublic void encodeBeginForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.context.ResponseWriter writer,
String clientId)
throws IOException
context - component - writer - clientId - IOExceptionpublic void encodeEndFormIfNessesary(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
context - component - IOExceptionpublic static void writeState(javax.faces.context.FacesContext context)
throws IOException
context - IOExceptionpublic void encodeEndForm(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
throws IOException
context - writer - IOExceptionpublic String getActionUrl(javax.faces.context.FacesContext facesContext)
facesContext - public String clientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
encodeIdcontext - component - public void writeScript(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object script)
throws IOException
context - component - script - IOExceptionpublic String correctForIdReference(String forAttr, javax.faces.component.UIComponent component)
forAttr - component - public void encodeChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
IOExceptionpublic boolean hasExplicitId(javax.faces.component.UIComponent component)
public javax.faces.component.UIComponent findComponentFor(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String id)
public javax.faces.component.UIComponent findComponentFor(javax.faces.component.UIComponent component,
String id)
component - id - Copyright © 2012 JBoss by Red Hat. All Rights Reserved.