|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.faces.render.Renderer | +--org.apache.struts.faces.renderer.AbstractRenderer
Abstract base class for concrete implementations of
javax.faces.render.Renderer
for the
Struts-Faces Integration Library.
Constructor Summary | |
AbstractRenderer()
|
Method Summary | |
protected void |
addConverterMessage(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String text)
Add an error message denoting a conversion failure. |
void |
decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Decode the current state of the specified UIComponent from the request contained in the specified FacesContext , and
attempt to convert this state information into an object of the
type equired for this component. |
void |
encodeBegin(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Render the beginning specified UIComponent to the
output stream or writer associated with the response we are creating. |
void |
encodeChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Render the child components of this UIComponent , following
the rules described for encodeBegin() to acquire the
appropriate value to be rendered. |
void |
encodeEnd(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Render the ending of the current state of the specified UIComponent , following the rules described for
encodeBegin() to acquire the appropriate value
to be rendered. |
protected javax.faces.application.Application |
getApplication()
Return the Application instance for this webapp. |
protected java.lang.Object |
getAsObject(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String value)
Convert the String representation of this component's value to the corresponding Object representation. |
protected java.lang.String |
getAsString(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
Convert the Object representation of this component's value to the corresponding String representation. |
java.lang.String |
getClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Return the client-side id for the argument component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractRenderer()
Method Detail |
public java.lang.String getClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
Return the client-side id for the argument component.
The purpose of this method is to give Renderers a chance to define, in a rendering specific way, the client side id for this component. The client side id should be derived from the component id, if present.
Look up this component's "clientId" attribute. If non-null,
return it. Get the component id for the argument
UIComponent
. If null, generate one using the closest
naming container that is an ancestor of this UIComponent, then set
the generated id as the componentId of this UIComponent. Prepend
to the component id the component ids of each naming container up
to, but not including, the root, separated by the
UIComponent.SEPARATOR_CHAR. In all cases, save the result as the
value of the "clientId" attribute.
This method must not return null.
getClientId
in class javax.faces.render.Renderer
public void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
Decode the current state of the specified UIComponent from the
request contained in the specified FacesContext
, and
attempt to convert this state information into an object of the
type equired for this component.
decode
in class javax.faces.render.Renderer
context
- FacesContext for the request we are processingcomponent
- UIComponent to be decoded
true
if conversion was successful (or no
conversion processing was required), or false
if
conversion was not successful
java.io.IOException
- if an input/output error occurs while decoding
java.lang.NullPointerException
- if context or component is nullpublic void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
Render the beginning specified UIComponent
to the
output stream or writer associated with the response we are creating.
If the conversion attempted in a previous call to decode
for this component failed, the state information saved during execution
of decode()
should be utilized to reproduce the incorrect
input. If the conversion was successful, or if there was no previous
call to decode()
, the value to be displayed should be
acquired by calling component.currentValue()
, and
rendering the value as appropriate.
encodeBegin
in class javax.faces.render.Renderer
context
- FacesContext for the request we are processingcomponent
- UIComponent to be rendered
java.io.IOException
- if an input/output error occurs while rendering
java.lang.NullPointerException
- if context
or component
is nullpublic void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
Render the child components of this UIComponent
, following
the rules described for encodeBegin()
to acquire the
appropriate value to be rendered. This method will only be called
if the rendersChildren
property of this component
is true
.
encodeChildren
in class javax.faces.render.Renderer
context
- FacesContext for the response we are creatingcomponent
- UIComponent whose children are to be rendered
java.io.IOException
- if an input/output error occurs while rendering
java.lang.NullPointerException
- if context
is null
public void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
Render the ending of the current state of the specified
UIComponent
, following the rules described for
encodeBegin()
to acquire the appropriate value
to be rendered.
encodeEnd
in class javax.faces.render.Renderer
context
- FacesContext for the response we are creatingcomponent
- UIComponent whose children are to be rendered
java.io.IOException
- if an input/output error occurs while rendering
java.lang.NullPointerException
- if context
is null
protected void addConverterMessage(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String text)
Add an error message denoting a conversion failure.
context
- The FacesContext
for this requestcomponent
- The UIComponent
that experienced
the conversion failuretext
- The text of the error messageprotected javax.faces.application.Application getApplication()
Return the Application
instance for this webapp.
protected java.lang.Object getAsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String value) throws javax.faces.convert.ConverterException
Convert the String representation of this component's value
to the corresponding Object representation. The default
implementation utilizes the getAsObject()
method of any
associated Converter
.
context
- The FacesContext
for this requestcomponent
- The UIComponent
whose value is
being convertedvalue
- The String representation to be converted
javax.faces.convert.ConverterException
- if conversion failsprotected java.lang.String getAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value) throws javax.faces.convert.ConverterException
Convert the Object representation of this component's value
to the corresponding String representation. The default implementation
utilizes the getAsString()
method of any associated
Converter
.
context
- The FacesContext
for this requestcomponent
- The UIComponent
whose value is
being convertedvalue
- The Object representation to be converted
javax.faces.convert.ConverterException
- if conversion fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |