public class ContextualCompositeMethodExpression
extends javax.el.MethodExpression
This specialized MethodExpression enables the evaluation of
composite component expressions. Instances of this expression will be created
when TagAttributeImpl.getValueExpression(javax.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 MethodExpressions 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>
When commandButton is clicked, the ContextualCompositeMethodExpression
first is looked up by TagAttributeImpl.AttributeLookupMethodExpression
which results an instance of ContextualCompositeMethodExpression.
When this ContextualCompositeMethodExpression is invoked, the Location
object necessary to find the proper composite component will be derived from
source ValueExpression provided at construction time. Using the
derived Location, 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 the Resource
instance associated with each composite component. If a matching composite
component is found, it will be made available to the EL by calling CompositeComponentStackManager.push(javax.faces.component.UIComponent).
| Constructor and Description |
|---|
ContextualCompositeMethodExpression(javax.faces.view.Location location,
javax.el.MethodExpression delegate) |
ContextualCompositeMethodExpression(javax.el.ValueExpression source,
javax.el.MethodExpression delegate) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getExpressionString() |
javax.el.MethodInfo |
getMethodInfo(javax.el.ELContext elContext) |
int |
hashCode() |
Object |
invoke(javax.el.ELContext elContext,
Object[] objects) |
boolean |
isLiteralText() |
public ContextualCompositeMethodExpression(javax.el.ValueExpression source,
javax.el.MethodExpression delegate)
public ContextualCompositeMethodExpression(javax.faces.view.Location location,
javax.el.MethodExpression delegate)
public javax.el.MethodInfo getMethodInfo(javax.el.ELContext elContext)
getMethodInfo in class javax.el.MethodExpressionpublic Object invoke(javax.el.ELContext elContext, Object[] objects)
invoke in class javax.el.MethodExpressionpublic String getExpressionString()
getExpressionString in class javax.el.Expressionpublic boolean equals(Object o)
equals in class javax.el.Expressionpublic int hashCode()
hashCode in class javax.el.Expressionpublic boolean isLiteralText()
isLiteralText in class javax.el.ExpressionCopyright © 2010–2020 JBoss by Red Hat. All rights reserved.