|
||||||||||
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.
IMPLEMENTATION NOTE - The default implementation assumes that a particular UIComponent class is supported if we have declared support for that class's component type.
Field Summary | |
private java.util.HashMap |
components
The supported component descriptions for the component types supported by this Renderer, keyed by component type. |
private java.lang.String |
rendererType
The renderer type implemented by this Renderer. |
Constructor Summary | |
AbstractRenderer()
|
Method Summary | |
void |
addSupportedComponent(SupportedComponent component)
Add a new supported component for this Renderer. |
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. |
javax.faces.component.AttributeDescriptor |
getAttributeDescriptor(java.lang.String componentType,
java.lang.String name)
Return an AttributeDescriptor for the specified
attribute name, as supported for the specified component type. |
javax.faces.component.AttributeDescriptor |
getAttributeDescriptor(javax.faces.component.UIComponent component,
java.lang.String name)
Return an AttributeDescriptor for the specified
attribute name, as supported for the specified UIComponent
class. |
java.util.Iterator |
getAttributeNames(java.lang.String componentType)
Return an Iterator over the names of the supported attributes for the specified component type. |
java.util.Iterator |
getAttributeNames(javax.faces.component.UIComponent component)
Return an Iterator over the names of the supported attributes for the specified UIComponent class. |
java.lang.String |
getClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Return the client-side id for the argument component. |
java.lang.String |
getRendererType()
Return the renderer type for this Renderer. |
void |
setRendererType(java.lang.String rendererType)
Set the renderer type for this Renderer. |
boolean |
supportsComponentType(java.lang.String componentType)
Return true if this Renderer supports the specified
component type. |
boolean |
supportsComponentType(javax.faces.component.UIComponent component)
Return true if this Renderer supports the specified
component class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.HashMap components
The supported component descriptions for the component types supported by this Renderer, keyed by component type.
private java.lang.String rendererType
The renderer type implemented by this Renderer.
Constructor Detail |
public AbstractRenderer()
Method Detail |
public java.lang.String getRendererType()
Return the renderer type for this Renderer.
public void setRendererType(java.lang.String rendererType)
Set the renderer type for this Renderer.
rendererType
- The new renderer typepublic 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
public javax.faces.component.AttributeDescriptor getAttributeDescriptor(java.lang.String componentType, java.lang.String name)
Return an AttributeDescriptor
for the specified
attribute name, as supported for the specified component type.
getAttributeDescriptor
in class javax.faces.render.Renderer
componentType
- Component type that is supportedname
- Attribute naem for which to return a descriptor
java.lang.IllegalArgumentException
- if the specified component type
is not supported
java.lang.IllegalArgumentException
- if the specified attribute name
is not supported for the specified component type
java.lang.NullPointerException
- if componentType or name is nullpublic javax.faces.component.AttributeDescriptor getAttributeDescriptor(javax.faces.component.UIComponent component, java.lang.String name)
Return an AttributeDescriptor
for the specified
attribute name, as supported for the specified UIComponent
class.
getAttributeDescriptor
in class javax.faces.render.Renderer
component
- UIComponent whose implementation class is supportedname
- Attribute naem for which to return a descriptor
java.lang.IllegalArgumentException
- if the specified component class
is not supported
java.lang.IllegalArgumentException
- if the specified attribute name
is not supported for the specified component class
java.lang.NullPointerException
- if component or name is nullpublic java.util.Iterator getAttributeNames(java.lang.String componentType)
Return an Iterator over the names of the supported attributes for the specified component type. If no attributes are supported, an empty Iterator is returned.
getAttributeNames
in class javax.faces.render.Renderer
componentType
- Component type that is supported
java.lang.IllegalArgumentException
- if the specified component type
is not supported
java.lang.NullPointerException
- if componentType is nullpublic java.util.Iterator getAttributeNames(javax.faces.component.UIComponent component)
Return an Iterator over the names of the supported attributes for the specified UIComponent class. If no attributes are supported, an empty Iterator is returned.
getAttributeNames
in class javax.faces.render.Renderer
component
- UIComponent whose implementation class is supported
java.lang.IllegalArgumentException
- if the specified component class
is not supported
java.lang.NullPointerException
- if component is nullpublic boolean supportsComponentType(java.lang.String componentType)
Return true
if this Renderer supports the specified
component type.
supportsComponentType
in class javax.faces.render.Renderer
componentType
- Component type to be checkedpublic boolean supportsComponentType(javax.faces.component.UIComponent component)
Return true
if this Renderer supports the specified
component class.
supportsComponentType
in class javax.faces.render.Renderer
component
- Component whose class is to be checkedpublic void addSupportedComponent(SupportedComponent component)
Add a new supported component for this Renderer.
component
- The supported component instance to be added
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |