jmcnally    01/05/29 18:08:54

  Modified:    src/java/org/apache/turbine/services/intake/model Field.java
  Log:
  fix ClassCastException for the "required" field rule.
  
  also allow access to the validator.
  
  Revision  Changes    Path
  1.13      +9 -4      
jakarta-turbine/src/java/org/apache/turbine/services/intake/model/Field.java
  
  Index: Field.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/intake/model/Field.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Field.java        2001/05/18 19:35:43     1.12
  +++ Field.java        2001/05/30 01:08:52     1.13
  @@ -74,7 +74,7 @@
    * Base class for Intake generated input processing classes.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]>John McNally</a>
  - * @version $Id: Field.java,v 1.12 2001/05/18 19:35:43 jmcnally Exp $
  + * @version $Id: Field.java,v 1.13 2001/05/30 01:08:52 jmcnally Exp $
    */
   public abstract class Field
   {
  @@ -156,10 +156,10 @@
           }
   
           // field may have been declared as always required in the xml spec
  -        String required = (String)field.getRuleMap().get("required");
  -        if ( required != null ) 
  +        Rule reqRule = (Rule)field.getRuleMap().get("required");
  +        if ( reqRule != null ) 
           {
  -            alwaysRequired = new Boolean(required).booleanValue();
  +            alwaysRequired = new Boolean(reqRule.getValue()).booleanValue();
           }
   
           mapToObject = field.getMapToObject();
  @@ -300,6 +300,11 @@
       protected String getDefaultValidator()
       {
           return "org.apache.turbine.services.intake.validator.DefaultValidator";
  +    }
  +
  +    public Validator getValidator()
  +    {
  +        return validator;
       }
       
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to