Package jakarta.faces.view.facelets
Class TagAttribute
java.lang.Object
jakarta.faces.view.facelets.TagAttribute
Representation of an XML attribute name=value pair on an XML element in a Facelet file.
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleangetBoolean(FaceletContext ctx) If literal,returnBoolean.valueOf(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 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()A reference to the Tag for which this class represents the attributes.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 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 ${..})voidSet a reference to the Tag for which this class represents the attributes.
-
Constructor Details
-
TagAttribute
public TagAttribute()
-
-
Method Details
-
getBoolean
If literal,return
Boolean.valueOf(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 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:
-
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:
-
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:
-
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:
-
getValueExpression
Create a ValueExpression, using this attribute's literal value and the passed expected type.- Parameters:
ctx- FaceletContext to use.type- expected return type.- Returns:
- the
ValueExpression. - See Also:
-
isLiteral
public abstract boolean isLiteral()If this TagAttribute is literal (not #{..} or ${..})- Returns:
- true if this attribute is literal.
-
getTag
A reference to the Tag for which this class represents the attributes. For compatibility with previous implementations, an implementation is provided that returns
null.- Returns:
- the
Tagfor which this class represents the attributes. - Since:
- 2.2
-
setTag
Set a reference to the Tag for which this class represents the attributes. The VDL runtime must ensure that this method is called before any
FaceletHandlers for this element are instantiated. For compatibility with previous implementations, a no-op implementation is provided.- Parameters:
tag- the tag we represent.- Since:
- 2.2
-