Package com.sun.faces.facelets.el
Class ContextualCompositeMethodExpression
- java.lang.Object
-
- jakarta.el.Expression
-
- jakarta.el.MethodExpression
-
- com.sun.faces.facelets.el.ContextualCompositeMethodExpression
-
- All Implemented Interfaces:
Serializable
public class ContextualCompositeMethodExpression extends jakarta.el.MethodExpression
This specialized
MethodExpression
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:MethodExpression
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 do="#{bean.action}" /> comp1.xhtml --------------------------------- <composite:interface> <composite:attribute name="do" method-signature="String f()" required="true" /> </composite:interface> <composite:implementation> <ez:nesting> <h:commandButton value="Click Me!" action="#{cc.attrs.do} /> </ez:nesting> </composite:implementation> nesting.xhtml --------------------------------- <composite:interface /> <composite:implementation> <composite:insertChildren> </composite:implementation>
WhencommandButton
is clicked, theContextualCompositeMethodExpression
first is looked up byTagAttributeImpl.AttributeLookupMethodExpression
which results an instance ofContextualCompositeMethodExpression
. When thisContextualCompositeMethodExpression
is invoked, theLocation
object necessary to find the proper composite component will be derived from sourceValueExpression
provided at construction time. Using the derivedLocation
, we can find the composite component that matches '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 ContextualCompositeMethodExpression(jakarta.el.ValueExpression source, jakarta.el.MethodExpression delegate)
ContextualCompositeMethodExpression(Location location, jakarta.el.MethodExpression delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getExpressionString()
jakarta.el.MethodInfo
getMethodInfo(jakarta.el.ELContext elContext)
int
hashCode()
Object
invoke(jakarta.el.ELContext elContext, Object[] objects)
boolean
isLiteralText()
-
-
-
Constructor Detail
-
ContextualCompositeMethodExpression
public ContextualCompositeMethodExpression(jakarta.el.ValueExpression source, jakarta.el.MethodExpression delegate)
-
ContextualCompositeMethodExpression
public ContextualCompositeMethodExpression(Location location, jakarta.el.MethodExpression delegate)
-
-
Method Detail
-
getMethodInfo
public jakarta.el.MethodInfo getMethodInfo(jakarta.el.ELContext elContext)
- Specified by:
getMethodInfo
in classjakarta.el.MethodExpression
-
invoke
public Object invoke(jakarta.el.ELContext elContext, Object[] objects)
- Specified by:
invoke
in classjakarta.el.MethodExpression
-
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
-
-