|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.util.Tags
public class Tags
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 Summary | |
---|---|
Tags()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tags()
Method Detail |
---|
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 expressionpublic Boolean evalBoolean(String expression)
Evaluate the expression
and return a Boolean
.
expression
- The expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |