@Typed public final class Facelets extends Object
Collection of utility methods for Facelets code.
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(javax.faces.view.facelets.FaceletContext context,
javax.faces.view.facelets.TagAttribute tagAttribute)
Returns the boolean value of the given tag attribute.
|
static Object |
getObject(javax.faces.view.facelets.FaceletContext context,
javax.faces.view.facelets.TagAttribute tagAttribute)
Returns the Object value of the given tag attribute
|
static <T> T |
getObject(javax.faces.view.facelets.FaceletContext context,
javax.faces.view.facelets.TagAttribute tagAttribute,
Class<?> type)
Returns the typed Object value of the given tag attribute
|
static String |
getString(javax.faces.view.facelets.FaceletContext context,
javax.faces.view.facelets.TagAttribute tagAttribute)
Returns the String value of the given tag attribute.
|
static String |
getStringLiteral(javax.faces.view.facelets.TagAttribute tagAttribute,
String name)
Returns the String literal of the given tag attribute.
|
static javax.el.ValueExpression |
getValueExpression(javax.faces.view.facelets.FaceletContext context,
javax.faces.view.facelets.TagAttribute tagAttribute,
Class<?> type)
Returns the value of the given tag attribute as a value expression, so it can be carried around and evaluated at
a later moment in the lifecycle without needing the Facelet context.
|
public static String getString(javax.faces.view.facelets.FaceletContext context, javax.faces.view.facelets.TagAttribute tagAttribute)
context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.public static String getStringLiteral(javax.faces.view.facelets.TagAttribute tagAttribute, String name)
tagAttribute
- The tag attribute to retrieve the value from.name
- The tag attribute name; this is only used in exception message.IllegalArgumentException
- When the attribute is not a literal.public static boolean getBoolean(javax.faces.view.facelets.FaceletContext context, javax.faces.view.facelets.TagAttribute tagAttribute)
context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.public static Object getObject(javax.faces.view.facelets.FaceletContext context, javax.faces.view.facelets.TagAttribute tagAttribute)
context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.public static <T> T getObject(javax.faces.view.facelets.FaceletContext context, javax.faces.view.facelets.TagAttribute tagAttribute, Class<?> type)
T
- The expected return type.context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.type
- The expected type of the Object value.ClassCastException
- When T
is of wrong type.public static javax.el.ValueExpression getValueExpression(javax.faces.view.facelets.FaceletContext context, javax.faces.view.facelets.TagAttribute tagAttribute, Class<?> type)
context
- The involved Facelet context.tagAttribute
- The tag attribute to extract the value expression from.type
- The expected type of the value behind the value expression.Copyright © 2012–2017 OmniFaces. All rights reserved.