This specialized ValueExpression 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 ValueExpressions 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 and ez: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 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 | Field and Description |
|---|---|
| private Location | |
| private ValueExpression | |
| private static final long |
| 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 Class | getExpectedType()
Implements abstract javax. |
| public String | getExpressionString()
Implements abstract javax. Expression,
unmodified.
|
| public Location | |
| public Class | getType(ELContext
The context of this evaluation. elContext)Implements abstract javax. value parameter in a future call
to the setValue method.
|
| public Object | getValue(ELContext
The context of this evaluation. elContext)Implements abstract javax. |
| public int | hashCode()
Implements abstract javax. Expression.
|
| public boolean | isLiteralText()
Implements abstract javax. |
| public boolean | isReadOnly(ELContext
The context of this evaluation. elContext)Implements abstract javax. true if a call to setValue will
always fail.
|
| private void | |
| private boolean | |
| public void | setValue(ELContext
The context of this evaluation. elContext, Object The new value to be set. o)Implements abstract javax. |
| public String |
| location | back to summary |
|---|---|
| private Location location | |
| originalVE | back to summary |
|---|---|
| private ValueExpression originalVE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ContextualCompositeValueExpression | back to summary |
|---|---|
| public ContextualCompositeValueExpression() | |
| ContextualCompositeValueExpression | back to summary |
|---|---|
| public ContextualCompositeValueExpression(Location location, ValueExpression originalVE) | |
| 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,
| |
| getExpectedType | back to summary |
|---|---|
| public Class Implements abstract javax. Doc from javax. Returns the type the result of the expression will be coerced to after evaluation. | |
| 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
| |
| getLocation | back to summary |
|---|---|
| public Location getLocation() | |
| getType | back to summary |
|---|---|
| public Class Implements abstract javax. Doc from javax. Evaluates the expression relative to the provided context, and
returns the most general type that is acceptable for an object to be
passed as the This is not always the same as | |
| getValue | back to summary |
|---|---|
| public Object getValue(ELContext elContext) Implements abstract javax. Doc from javax. Evaluates the expression relative to the provided context, and returns the resulting value. The resulting value is automatically coerced to the type
returned by | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract javax. Doc from javax. Returns the hash code for this See the note in the
| |
| 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
| |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly(ELContext elContext) Implements abstract javax. Doc from javax. Evaluates the expression relative to the provided context, and
returns | |
| popCompositeComponent | back to summary |
|---|---|
| private void popCompositeComponent(FacesContext ctx) | |
| pushCompositeComponent | back to summary |
|---|---|
| private boolean pushCompositeComponent(FacesContext ctx) | |
| setValue | back to summary |
|---|---|
| public void setValue(ELContext elContext, Object o) Implements abstract javax. Doc from javax. Evaluates the expression relative to the provided context, and sets the result to the provided value. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |