Package org.infoglue.cms.util.validators

Examples of org.infoglue.cms.util.validators.Range


    // Create a new constraintrule, supply constraint type, and field that this rule
    // applies to.
     ConstraintRule cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.STRING, "Publication.name");

     // Set the constraints
     cr.setValidRange(new Range(2, 50) );
     cr.unique=false// public variabel will be changed to setter later
     cr.required=true; // public variabel will be changed to setter later
     cr.setValue(name);

     // Add this rule to the rulelist
     rules.addRule(cr);

    // Create a new constraintrule, supply constraint type, and field that this rule
    // applies to.
     cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.STRING, "Publication.description");

     // Set the constraints
     cr.setValidRange(new Range(2, 50) );
     cr.unique=false// public variabel will be changed to setter later
     cr.required=true; // public variabel will be changed to setter later
     cr.setValue(description);

     // Add this rule to the rulelist
View Full Code Here


    // Create a new constraintrule, supply constraint type, and field that this rule
    // applies to.
     ConstraintRule cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.STRING, "SystemUser.userName");
    
     // Set the constraints
     cr.setValidRange(new Range(2, 60) );
     cr.unique=true// public variabel will be changed to setter later
     cr.required=true; // public variabel will be changed to setter later
     cr.setValue(userName);
    
     // Add this rule to the rulelist
     rules.addRule(cr);   

    // Set the rest of the rules
     cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.STRING, "SystemUser.password");
     cr.setValidRange(new Range(4, 15));
     cr.required = true;
     cr.setValue(password);
    rules.addRule(cr);
   
     cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.STRING, "SystemUser.firstName");
     cr.setValidRange(new Range(1, 30));
     cr.required = true;
     cr.setValue(firstName);
    rules.addRule(cr);
   
     cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.STRING, "SystemUser.lastName");
     cr.setValidRange(new Range(1, 30));
     cr.required = true;
     cr.setValue(lastName);
    rules.addRule(cr);

     cr = new ConstraintRule(org.infoglue.cms.util.validators.Constants.EMAIL, "SystemUser.email");
     cr.setValidRange(new Range(50));
     cr.required = true;
     cr.setValue(email);
    rules.addRule(cr);
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.util.validators.Range

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.