This specialized ValueExpression enables the evaluation of composite component expressions. Instances of
this expression will be created when
com.
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
jakarta. 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(jakarta..
| 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 jakarta. Determines whether the specified object is equal to this |
| public Class | getExpectedType()
Implements abstract jakarta. Returns the type the result of the expression will be coerced to after evaluation. |
| public String | getExpressionString()
Implements abstract jakarta. Returns the original String used to create this |
| public Location | |
| public Class | getType(ELContext
The context of this evaluation. elContext)Implements abstract jakarta. 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 |
| public Object | getValue(ELContext
The context of this evaluation. elContext)Implements abstract jakarta. Evaluates the expression relative to the provided context, and returns the resulting value. |
| public ValueReference | getValueReference(ELContext
the context of this evaluation elContext)Overrides jakarta. Returns a |
| public int | hashCode()
Implements abstract jakarta. Returns the hash code for this |
| public boolean | isLiteralText()
Implements abstract jakarta. Returns whether this expression was created from only literal text. |
| public boolean | isReadOnly(ELContext
The context of this evaluation. elContext)Implements abstract jakarta. Evaluates the expression relative to the provided context, and returns |
| private void | |
| private boolean | |
| public void | setValue(ELContext
The context of this evaluation. elContext, Object The new value to be set. o)Implements abstract jakarta. Evaluates the expression relative to the provided context, and sets the result to the provided value. |
| 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 jakarta. Doc from jakarta. 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 jakarta. Doc from jakarta. Returns the type the result of the expression will be coerced to after evaluation. | |
| getExpressionString | back to summary |
|---|---|
| public String getExpressionString() Implements abstract jakarta. Doc from jakarta. 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 jakarta. Doc from jakarta. 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 jakarta. Doc from jakarta. Evaluates the expression relative to the provided context, and returns the resulting value.
The resulting value is automatically coerced to the type returned by | |
| getValueReference | back to summary |
|---|---|
| public ValueReference getValueReference(ELContext elContext) Overrides jakarta. Doc from jakarta. Returns a
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract jakarta. Doc from jakarta. Returns the hash code for this
See the note in the
| |
| isLiteralText | back to summary |
|---|---|
| public boolean isLiteralText() Implements abstract jakarta. Doc from jakarta. 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 jakarta. Doc from jakarta. 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 jakarta. Doc from jakarta. 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.
Satisfying this method's contract implies a non- | |