com.sun.faces.facelets.el
public final class ContextualCompositeValueExpression extends javax.el.ValueExpression
This specialized ValueExpression
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 ValueExpression
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 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 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 javax.faces.view.Location |
location |
private javax.el.ValueExpression |
originalVE |
Constructor and Description |
---|
ContextualCompositeValueExpression() |
ContextualCompositeValueExpression(javax.faces.view.Location location,
javax.el.ValueExpression originalVE) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Class<?> |
getExpectedType() |
java.lang.String |
getExpressionString() |
javax.faces.view.Location |
getLocation() |
java.lang.Class<?> |
getType(javax.el.ELContext elContext) |
java.lang.Object |
getValue(javax.el.ELContext elContext) |
int |
hashCode() |
boolean |
isLiteralText() |
boolean |
isReadOnly(javax.el.ELContext elContext) |
private void |
popCompositeComponent(javax.faces.context.FacesContext ctx) |
private boolean |
pushCompositeComponent(javax.faces.context.FacesContext ctx) |
void |
setValue(javax.el.ELContext elContext,
java.lang.Object o) |
java.lang.String |
toString() |
private javax.el.ValueExpression originalVE
private javax.faces.view.Location location
public ContextualCompositeValueExpression()
public ContextualCompositeValueExpression(javax.faces.view.Location location, javax.el.ValueExpression originalVE)
public java.lang.Object getValue(javax.el.ELContext elContext)
getValue
in class javax.el.ValueExpression
public void setValue(javax.el.ELContext elContext, java.lang.Object o)
setValue
in class javax.el.ValueExpression
public boolean isReadOnly(javax.el.ELContext elContext)
isReadOnly
in class javax.el.ValueExpression
public java.lang.Class<?> getType(javax.el.ELContext elContext)
getType
in class javax.el.ValueExpression
public java.lang.Class<?> getExpectedType()
getExpectedType
in class javax.el.ValueExpression
public java.lang.String getExpressionString()
getExpressionString
in class javax.el.Expression
public boolean equals(java.lang.Object o)
equals
in class javax.el.Expression
public int hashCode()
hashCode
in class javax.el.Expression
public boolean isLiteralText()
isLiteralText
in class javax.el.Expression
public java.lang.String toString()
toString
in class java.lang.Object
public javax.faces.view.Location getLocation()
Location
of this ValueExpression
private boolean pushCompositeComponent(javax.faces.context.FacesContext ctx)
private void popCompositeComponent(javax.faces.context.FacesContext ctx)
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.