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

Gavin King gavin.king at jboss.com
Fri Jan 26 20:55:25 EST 2007


  User: gavin   
  Date: 07/01/26 20:55:25

  Modified:    src/main/org/jboss/seam/core   Interpolator.java
                        Validators.java
  Log:
  added controller fwk JBSEAM-646
  
  Revision  Changes    Path
  1.17      +2 -1      jboss-seam/src/main/org/jboss/seam/core/Interpolator.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Interpolator.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Interpolator.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- Interpolator.java	8 Jan 2007 22:03:14 -0000	1.16
  +++ Interpolator.java	27 Jan 2007 01:55:25 -0000	1.17
  @@ -48,7 +48,8 @@
       * @param string a template
       * @return the interpolated string
       */
  -   public String interpolate(String string, Object... params) {
  +   public String interpolate(String string, Object... params) 
  +   {
         if (params == null) 
         {
            params = new Object[0];
  
  
  
  1.2       +34 -1     jboss-seam/src/main/org/jboss/seam/core/Validators.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Validators.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Validators.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Validators.java	18 Dec 2006 15:38:49 -0000	1.1
  +++ Validators.java	27 Jan 2007 01:55:25 -0000	1.2
  @@ -34,6 +34,12 @@
   
      private Map<Class, ClassValidator> classValidators = Collections.synchronizedMap( new HashMap<Class, ClassValidator>() ); 
      
  +   /**
  +    * Get the cached ClassValidator instance.
  +    * 
  +    * @param modelClass the class to be validated
  +    * @param name the component name
  +    */
      public ClassValidator getValidator(Class modelClass, String name)
      {
         ClassValidator result = classValidators.get(modelClass);
  @@ -45,7 +51,25 @@
         return result;
      }
      
  -   public ClassValidator createValidator(Class modelClass, String name)
  +   /**
  +    * Get the cached ClassValidator instance.
  +    * 
  +    * @param modelClass the class to be validated
  +    */
  +   public <T> ClassValidator<T> getValidator(Class<T> modelClass)
  +   {
  +      return getValidator(modelClass);
  +   }
  +   
  +   /**
  +    * Create a new ClassValidator, or get it from the
  +    * Component object for the default role of the 
  +    * class.
  +    * 
  +    * @param modelClass the class to be validated
  +    * @param name the component name
  +    */
  +   protected ClassValidator createValidator(Class modelClass, String name)
      {
         Component component = name==null ? null : Component.forName(name);
         if (component==null)
  @@ -61,6 +85,15 @@
         }
      }
   
  +   /**
  +    * Validate that a value can be assigned to the property
  +    * identified by a value expression.
  +    * 
  +    * @param context the FacesContext
  +    * @param propertyExpression a value expression
  +    * @param value the value that is to be assigned
  +    * @return the validation failures, as InvalidValues
  +    */
      public InvalidValue[] validate(FacesContext context, String propertyExpression, Object value)
      {
         int dot = propertyExpression.lastIndexOf('.');
  
  
  



More information about the jboss-cvs-commits mailing list