@Typed public final class Facelets extends Object
Collection of utility methods for Facelets code.
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(jakarta.faces.view.facelets.FaceletContext context,
jakarta.faces.view.facelets.TagAttribute tagAttribute)
Returns the boolean value of the given tag attribute.
|
static Object |
getObject(jakarta.faces.view.facelets.FaceletContext context,
jakarta.faces.view.facelets.TagAttribute tagAttribute)
Returns the Object value of the given tag attribute
|
static <T> T |
getObject(jakarta.faces.view.facelets.FaceletContext context,
jakarta.faces.view.facelets.TagAttribute tagAttribute,
Class<?> type)
Returns the typed Object value of the given tag attribute
|
static String |
getString(jakarta.faces.view.facelets.FaceletContext context,
jakarta.faces.view.facelets.TagAttribute tagAttribute)
Returns the String value of the given tag attribute.
|
static String |
getStringLiteral(jakarta.faces.view.facelets.TagAttribute tagAttribute,
String name)
Returns the String literal of the given tag attribute.
|
static jakarta.el.ValueExpression |
getValueExpression(jakarta.faces.view.facelets.FaceletContext context,
jakarta.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(jakarta.faces.view.facelets.FaceletContext context, jakarta.faces.view.facelets.TagAttribute tagAttribute)
context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.public static String getStringLiteral(jakarta.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(jakarta.faces.view.facelets.FaceletContext context, jakarta.faces.view.facelets.TagAttribute tagAttribute)
context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.public static Object getObject(jakarta.faces.view.facelets.FaceletContext context, jakarta.faces.view.facelets.TagAttribute tagAttribute)
context
- The involved Facelet context.tagAttribute
- The tag attribute to retrieve the value from.public static <T> T getObject(jakarta.faces.view.facelets.FaceletContext context, jakarta.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 jakarta.el.ValueExpression getValueExpression(jakarta.faces.view.facelets.FaceletContext context, jakarta.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–2020 OmniFaces. All rights reserved.