This specialized MethodExpression enables the evaluation of
composite component expressions. Instances of this expression will be created
when com.sun.faces.facelets.tag.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 com.sun.faces.facelets.tag.TagAttributeImpl.AttributeLookupMethodExpression
which results an instance of ContextualCompositeMethodExpression.
When this ContextualCompositeMethodExpression is invoked, the javax.faces.view.Location
object necessary to find the proper composite component will be derived from
source ValueExpression provided at construction time. Using the
derived javax.faces.view.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 javax.faces.application.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).
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private final MethodExpression | |
| private final Location | |
| private static final Logger | |
| private static final long | |
| private final ValueExpression |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the o)Object to test for equality.Implements abstract javax. Expression.
|
| public String | getExpressionString()
Implements abstract javax. Expression,
unmodified.
|
| public MethodInfo | getMethodInfo(ELContext
The context of this evaluation elContext)Implements abstract javax. |
| public int | hashCode()
Implements abstract javax. Expression.
|
| public Object | invoke(ELContext
The context of this evaluation. elContext, Object[] The parameters to pass to the method, or
objects)null if no parameters.Implements abstract javax. |
| public boolean | isLiteralText()
Implements abstract javax. |
| private void | |
| private boolean |
| ccClientId | back to summary |
|---|---|
| private String ccClientId | |
| delegate | back to summary |
|---|---|
| private final MethodExpression delegate | |
| location | back to summary |
|---|---|
| private final Location location | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| source | back to summary |
|---|---|
| private final ValueExpression source | |
| ContextualCompositeMethodExpression | back to summary |
|---|---|
| public ContextualCompositeMethodExpression(ValueExpression source, MethodExpression delegate) | |
| ContextualCompositeMethodExpression | back to summary |
|---|---|
| public ContextualCompositeMethodExpression(Location location, MethodExpression delegate) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Implements abstract javax. Doc from javax. Determines whether the specified object is equal to this
The result is Note that two expressions can be equal if their expression
Strings are different. For example,
| |
| getExpressionString | back to summary |
|---|---|
| public String getExpressionString() Implements abstract javax. Doc from javax. Returns the original String used to create this This is used for debugging purposes but also for the purposes of comparison (e.g. to ensure the expression in a configuration file has not changed). This method does not provide sufficient information to
re-create an expression. Two different expressions can have exactly
the same expression string but different function mappings.
Serialization should be used to save and restore the state of an
| |
| getMethodInfo | back to summary |
|---|---|
| public MethodInfo getMethodInfo(ELContext elContext) Implements abstract javax. Doc from javax. Evaluates the expression relative to the provided context, and returns information about the actual referenced method.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract javax. Doc from javax. Returns the hash code for this See the note in the
| |
| invoke | back to summary |
|---|---|
| public Object invoke(ELContext elContext, Object[] objects) Implements abstract javax. Doc from javax. If a String literal is specified as the expression, returns the
String literal coerced to the expected return type of the method
signature. An | |
| isLiteralText | back to summary |
|---|---|
| public boolean isLiteralText() Implements abstract javax. Doc from javax. Returns whether this expression was created from only literal text. This method must return
| |
| popCompositeComponent | back to summary |
|---|---|
| private void popCompositeComponent(FacesContext ctx) | |
| pushCompositeComponent | back to summary |
|---|---|
| private boolean pushCompositeComponent(FacesContext ctx) | |
| Modifier and Type | Field and Description |
|---|---|
| private ContextualCompositeMethodExpression |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | processEvent(ComponentSystemEvent
the event)ComponentSystemEvent instance that
is being processed.Implements javax. When called, the listener can assume that any guarantees given
in the javadoc for the specific |
| ccME | back to summary |
|---|---|
| private ContextualCompositeMethodExpression ccME | |
| SetClientIdListener | back to summary |
|---|---|
| public SetClientIdListener() | |
| SetClientIdListener | back to summary |
|---|---|
| public SetClientIdListener(ContextualCompositeMethodExpression ccME) | |
| processEvent | back to summary |
|---|---|
| public void processEvent(ComponentSystemEvent event) throws AbortProcessingException Implements javax. Doc from javax. When called, the listener can assume that any guarantees given
in the javadoc for the specific
| |