[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...

Gavin King gavin.king at jboss.com
Thu Jul 13 23:26:12 EDT 2006


  User: gavin   
  Date: 06/07/13 23:26:12

  Modified:    src/main/org/jboss/seam/core  Alias.java
  Log:
  updated docs
  
  Revision  Changes    Path
  1.2       +22 -1     jboss-seam/src/main/org/jboss/seam/core/Alias.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Alias.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Alias.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Alias.java	22 Jun 2006 02:24:51 -0000	1.1
  +++ Alias.java	14 Jul 2006 03:26:12 -0000	1.2
  @@ -2,6 +2,8 @@
   
   import static org.jboss.seam.InterceptionType.NEVER;
   
  +import javax.faces.context.FacesContext;
  +
   import org.jboss.seam.Component;
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.annotations.Intercept;
  @@ -20,14 +22,23 @@
   {
      
      private String name;
  +   private String expression;
      
      @Unwrap
      public Object getValue()
      {
         //Note that by making this component stateless, we ensure
         //that this method never gets called if create=false
  +      if (expression==null)
  +      {
         return Component.getInstance(name);
      }
  +      else
  +      {
  +         FacesContext facesContext = FacesContext.getCurrentInstance();
  +         return facesContext.getApplication().createValueBinding(expression).getValue(facesContext);
  +      }
  +   }
   
      public String getName()
      {
  @@ -39,4 +50,14 @@
         this.name = name;
      }
      
  +   public String getExpression()
  +   {
  +      return expression;
  +   }
  +
  +   public void setExpression(String expression)
  +   {
  +      this.expression = expression;
  +   }
  +   
   }
  
  
  



More information about the jboss-cvs-commits mailing list