public class Converter extends TagHandler
<o:converter>
basically extends the <f:converter>
tag family with the
possibility to evaluate the value expression in all attributes on a per request basis instead of on a per view
build time basis. This allows the developer to change the attributes on a per request basis.
When you specify for example the standard <f:convertDateTime>
by
converterId="javax.faces.DateTime"
, then you'll be able to use all its attributes such as
pattern
and locale
as per its documentation, but then with the possibility to supply
request based value expressions.
<o:converter converterId="javax.faces.DateTime" pattern="#{item.pattern}" locale="#{item.locale}" />
Modifier and Type | Class and Description |
---|---|
protected static class |
RenderTimeTagHandler.RenderTimeAttributes
Convenience class which holds all render time attribute setters and value expressions.
|
nextHandler, tag, tagId
Constructor and Description |
---|
Converter(TagConfig config)
The tag constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(FaceletContext context,
UIComponent parent)
If the parent component is new, then create a
Converter based on the
binding and/or converterId attributes as per the standard JSF
<f:converter> implementation and collect the render time attributes. |
protected RenderTimeTagHandler.RenderTimeAttributes |
collectRenderTimeAttributes(FaceletContext context,
Object object)
Collect the EL properties of the given object.
|
protected <T> ValueExpression |
getValueExpression(FaceletContext context,
String name,
Class<T> type)
Convenience method to get the given attribute as a
ValueExpression , or null if there is no
such attribute. |
getAttribute, getRequiredAttribute, toString
public Converter(TagConfig config)
config
- The tag config.public void apply(FaceletContext context, UIComponent parent) throws IOException
Converter
based on the
binding
and/or converterId
attributes as per the standard JSF
<f:converter>
implementation and collect the render time attributes. Then create an anonymous
Converter
implementation which wraps the created Converter
and delegates the methods
to it after setting the render time attributes. Finally set the anonymous implementation on the parent component.context
- The involved facelet context.parent
- The parent component to set the Converter
on.IOException
- If something fails at I/O level.protected RenderTimeTagHandler.RenderTimeAttributes collectRenderTimeAttributes(FaceletContext context, Object object)
context
- The involved facelet context.object
- The object to collect EL properties for.protected <T> ValueExpression getValueExpression(FaceletContext context, String name, Class<T> type)
ValueExpression
, or null
if there is no
such attribute.context
- The involved facelet context.name
- The attribute name to return the value expression for.type
- The type of the value expression.ValueExpression
.