Package jakarta.faces.view.facelets
Class TagAttribute
java.lang.Object
jakarta.faces.view.facelets.TagAttribute
Representation of a Tag's attribute in a Facelet File
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleangetBoolean(FaceletContext ctx) If literal, returnBoolean.getBoolean(java.lang.String)passing our value, otherwise callgetObject(FaceletContext, Class).abstract intgetInt(FaceletContext ctx) If literal, callInteger.parseInt(String), otherwise callgetObject(FaceletContext, Class).abstract StringLocal name of this attributeabstract LocationThe location of this attribute in the FaceletContextabstract jakarta.el.MethodExpressiongetMethodExpression(FaceletContext ctx, Class type, Class[] paramTypes) Create a MethodExpression, using this attribute's value as the expression String.abstract StringThe resolved Namespace for this attributeabstract ObjectgetObject(FaceletContext ctx) Delegates to getObject with Object.class as a paramabstract ObjectgetObject(FaceletContext ctx, Class type) If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.abstract StringgetQName()The qualified name for this attributegetTag()abstract StringgetValue()Return the literal value of this attributeabstract StringgetValue(FaceletContext ctx) If literal, then return our value, otherwise delegate to getObject, passing String.class.abstract jakarta.el.ValueExpressiongetValueExpression(FaceletContext ctx, Class type) Create a ValueExpression, using this attribute's literal value and the passed expected type.abstract booleanIf this TagAttribute is literal (not #{..} or ${..})void
-
Constructor Details
-
TagAttribute
public TagAttribute()
-
-
Method Details
-
getBoolean
If literal, returnBoolean.getBoolean(java.lang.String)passing our value, otherwise callgetObject(FaceletContext, Class).- Parameters:
ctx- FaceletContext to use- Returns:
- boolean value
- See Also:
-
getInt
If literal, callInteger.parseInt(String), otherwise callgetObject(FaceletContext, Class).- Parameters:
ctx- FaceletContext to use- Returns:
- int value
- See Also:
-
getLocalName
Local name of this attribute- Returns:
- local name of this attribute
-
getLocation
The location of this attribute in the FaceletContext- Returns:
- the TagAttribute's location
-
getMethodExpression
public abstract jakarta.el.MethodExpression getMethodExpression(FaceletContext ctx, Class type, Class[] paramTypes) Create a MethodExpression, using this attribute's value as the expression String.- Parameters:
ctx- FaceletContext to usetype- expected return typeparamTypes- parameter type- Returns:
- a MethodExpression instance
- See Also:
-
ExpressionFactory.createMethodExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[])MethodExpression
-
getNamespace
The resolved Namespace for this attribute- Returns:
- resolved Namespace
-
getObject
Delegates to getObject with Object.class as a param- Parameters:
ctx- FaceletContext to use- Returns:
- Object representation of this attribute's value
- See Also:
-
getObject
If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.- Parameters:
ctx- FaceletContext to usetype- expected return type- Returns:
- Object value of this attribute
- See Also:
-
ExpressionFactory.coerceToType(java.lang.Object, java.lang.Class)ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class)ValueExpression
-
getQName
The qualified name for this attribute- Returns:
- the qualified name for this attribute
-
getValue
Return the literal value of this attribute- Returns:
- literal value
-
getValue
If literal, then return our value, otherwise delegate to getObject, passing String.class.- Parameters:
ctx- FaceletContext to use- Returns:
- String value of this attribute
- See Also:
-
getValueExpression
Create a ValueExpression, using this attribute's literal value and the passed expected type.- Parameters:
ctx- FaceletContext to usetype- expected return type- Returns:
- ValueExpression instance
- See Also:
-
ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class)ValueExpression
-
isLiteral
public abstract boolean isLiteral()If this TagAttribute is literal (not #{..} or ${..})- Returns:
- true if this attribute is literal
-
getTag
- Returns:
- Since:
- 2.2
-
setTag
- Parameters:
tag-- Since:
- 2.2
-