public class Tags extends Object
A utility class for JSF tags. An instance of this class is
specified as an application-scoped managed bean in
faces-config.xml, under the name
org.apache.shale.TAG_UTILITY_BEAN.
The org.apache.shale.taglib.CommonsValidatorTag
uses that managed bean.
Nearly all of the methods of this class set a component attribute or
create a value- or method-binding, given a String representation
of the value. The methods check to see whether the value is a value
reference (ie. #{...}); if so, the methods set value
bindings or method bindings, as appropriate, for the component.
| Constructor and Description |
|---|
Tags() |
| Modifier and Type | Method and Description |
|---|---|
Object |
eval(String expression)
Evaluate the
expression. |
Boolean |
evalBoolean(String expression)
Evaluate the
expression and return a Boolean. |
Double |
evalDouble(String expression)
Evaluate the
expression and return a Double. |
Integer |
evalInteger(String expression)
Evaluate the
expression and return an Integer. |
String |
evalString(String expression)
Evaluate the
expression. |
void |
setAction(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's
Action
by setting a method binding with the given attribute
value. |
void |
setActionListener(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's
ActionListener
by setting a method binding with the given attribute
value. |
void |
setBoolean(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's
attributeName with the
given attributeValue as a Boolean. |
void |
setDouble(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's
attributeName with the
given attributeValue as a Double. |
void |
setInteger(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's
attributeName with the
given attributeValue as a Integer. |
void |
setMethodBinding(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue,
Class[] paramTypes)
Sets the component's
attributeName with the
given attributeValue as a MethodBinding. |
void |
setString(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's
attributeName with the
given attributeValue as a String. |
void |
setValidator(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's
Validator
by setting a method binding with the given attribute
value. |
void |
setValueBinding(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's
attributeName with the
given attributeValue as a ValueBinding. |
void |
setValueChangeListener(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's
ValueChangeListener
by setting a method binding with the given attribute
value. |
public void setString(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's attributeName with the
given attributeValue as a String.
If the attributeValue is null, do
nothing. If attributeValue is a value reference,
set a value binding for the component. Otherwise, store the
attributeValue in the component's attribute map.
component - The JSF componentattributeName - The name of the attribute to setattributeValue - The value of the attributepublic void setInteger(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's attributeName with the
given attributeValue as a Integer.
If the attributeValue is null, do
nothing. If attributeValue is a value reference,
set a value binding for the component. Otherwise, store the
attributeValue in the component's attribute map.
component - The JSF componentattributeName - The name of the attribute to setattributeValue - The value of the attributepublic void setDouble(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's attributeName with the
given attributeValue as a Double.
If the attributeValue is null, do
nothing. If attributeValue is a value reference,
set a value binding for the component. Otherwise, store the
attributeValue in the component's attribute map.
component - The JSF componentattributeName - The name of the attribute to setattributeValue - The value of the attributepublic void setBoolean(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's attributeName with the
given attributeValue as a Boolean.
If the attributeValue is null, do
nothing. If attributeValue is a value reference,
set a value binding for the component. Otherwise, store the
attributeValue in the component's attribute map.
component - The JSF componentattributeName - The name of the attribute to setattributeValue - The value of the attributepublic void setValueBinding(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue)
Sets the component's attributeName with the
given attributeValue as a ValueBinding.
If the attributeValue is null, do
nothing. If attributeValue is a value reference,
set a value binding for the component. Otherwise, store the
attributeValue in the component's attribute map.
component - The JSF componentattributeName - The name of the attribute to setattributeValue - The value of the attributepublic void setActionListener(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's ActionListener
by setting a method binding with the given attribute
value.
component - The JSF componentattributeValue - The value of the attributepublic void setValueChangeListener(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's ValueChangeListener
by setting a method binding with the given attribute
value.
component - The JSF componentattributeValue - The value of the attributepublic void setValidator(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's Validator
by setting a method binding with the given attribute
value.
component - The JSF componentattributeValue - The value of the attributepublic void setAction(javax.faces.component.UIComponent component,
String attributeValue)
Sets the component's Action
by setting a method binding with the given attribute
value.
component - The JSF componentattributeValue - The value of the attributepublic void setMethodBinding(javax.faces.component.UIComponent component,
String attributeName,
String attributeValue,
Class[] paramTypes)
Sets the component's attributeName with the
given attributeValue as a MethodBinding.
If the attributeValue is null, do
nothing. If attributeValue is a value reference,
set a value binding for the component. Otherwise, store the
attributeValue in the component's attribute map.
component - The JSF componentattributeName - The name of the attribute to setattributeValue - The value of the attributeparamTypes - Signature for method parameterspublic Object eval(String expression)
Evaluate the expression. If it's a value reference,
get the reference's value.
Otherwise, return the expression.
expression - The expressionpublic String evalString(String expression)
Evaluate the expression. If it's a value reference,
get the reference's value as a String.
Otherwise, return the expression.
expression - The expressionpublic Integer evalInteger(String expression)
Evaluate the expression and return an Integer.
expression - The expressionpublic Double evalDouble(String expression)
Evaluate the expression and return a Double.
expression - The expressionCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.