Class ContextualCompositeValueExpression
- java.lang.Object
-
- jakarta.el.Expression
-
- jakarta.el.ValueExpression
-
- com.sun.faces.facelets.el.ContextualCompositeValueExpression
-
- All Implemented Interfaces:
Serializable
public final class ContextualCompositeValueExpression extends jakarta.el.ValueExpression
This specialized
ValueExpression
enables the evaluation of composite component expressions. Instances of this expression will be created whenTagAttributeImpl.getValueExpression(jakarta.faces.view.facelets.FaceletContext, Class)
is invoked and the expression represents a composite component expression (i.e. #{cc.[properties]}).It's important to note that these
Here's an example:ValueExpression
s are context sensitive in that they leverage the location in which they were referenced in order to push the proper composite component to the evaluation context prior to evaluating the expression itself.Using Page test.xhtml --------------------------------- <ez:comp1 greeting="Hello!" /> comp1.xhtml --------------------------------- <composite:interface> <composite:attribute name="greeting" type="java.lang.String" required="true" /> </composite:interface> <composite:implementation> <ez:nesting> <h:outputText value="#{cc.attrs.greetings}" /> </ez:nesting> </composite:implementation> nesting.xhtml --------------------------------- <composite:interface /> <composite:implementation> <composite:insertChildren> </composite:implementation>
In the above example, there will be two composite components available to the runtime:
ez:comp1
andez:nesting
.When <h:outputText value="#{cc.attrs.greeting}" />, prior to attempting to evaluate the expression, the
Location
object will be used to find the composite component that 'owns' the template in which the expression was defined in by comparing the path of the Location with the name and library of theResource
instance associated with each composite component. If a matching composite component is found, it will be made available to the EL by callingCompositeComponentStackManager.push(jakarta.faces.component.UIComponent)
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContextualCompositeValueExpression()
ContextualCompositeValueExpression(Location location, jakarta.el.ValueExpression originalVE)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Class<?>
getExpectedType()
String
getExpressionString()
Location
getLocation()
Class<?>
getType(jakarta.el.ELContext elContext)
Object
getValue(jakarta.el.ELContext elContext)
jakarta.el.ValueReference
getValueReference(jakarta.el.ELContext elContext)
int
hashCode()
boolean
isLiteralText()
boolean
isReadOnly(jakarta.el.ELContext elContext)
void
setValue(jakarta.el.ELContext elContext, Object o)
String
toString()
-
-
-
Constructor Detail
-
ContextualCompositeValueExpression
public ContextualCompositeValueExpression()
-
ContextualCompositeValueExpression
public ContextualCompositeValueExpression(Location location, jakarta.el.ValueExpression originalVE)
-
-
Method Detail
-
getValue
public Object getValue(jakarta.el.ELContext elContext)
- Specified by:
getValue
in classjakarta.el.ValueExpression
-
setValue
public void setValue(jakarta.el.ELContext elContext, Object o)
- Specified by:
setValue
in classjakarta.el.ValueExpression
-
isReadOnly
public boolean isReadOnly(jakarta.el.ELContext elContext)
- Specified by:
isReadOnly
in classjakarta.el.ValueExpression
-
getType
public Class<?> getType(jakarta.el.ELContext elContext)
- Specified by:
getType
in classjakarta.el.ValueExpression
-
getExpectedType
public Class<?> getExpectedType()
- Specified by:
getExpectedType
in classjakarta.el.ValueExpression
-
getValueReference
public jakarta.el.ValueReference getValueReference(jakarta.el.ELContext elContext)
- Overrides:
getValueReference
in classjakarta.el.ValueExpression
-
getExpressionString
public String getExpressionString()
- Specified by:
getExpressionString
in classjakarta.el.Expression
-
equals
public boolean equals(Object o)
- Specified by:
equals
in classjakarta.el.Expression
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classjakarta.el.Expression
-
isLiteralText
public boolean isLiteralText()
- Specified by:
isLiteralText
in classjakarta.el.Expression
-
-