Examples of Perl5Util


Examples of org.apache.oro.text.perl.Perl5Util

    public ActionErrors validate(ActionMapping mapping,
        HttpServletRequest request) {
        // Perform validator framework validations
    ActionErrors errors = super.validate(mapping, request);
        Iterator it = getKeys().iterator();
    Perl5Util util = new Perl5Util();
        while (it.hasNext()) {
            String key = (String) it.next();
            if(!util.match("/^[a-fA-F0-9]{6}$/",(String) getValue(key))){
        errors.add(key, new ActionError("errors.color",key));
            }
        }

        return errors;
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

        return ourInstance;
    }

    private MessageProcessor() {
        perlUtil = new Perl5Util(cache);
    }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

     * @return DOCUMENT ME!
     */
    public boolean validateEmail(Object bean, ValidatorAction va, Field field,
        ActionErrors errors, HttpServletRequest request) {
        String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
        Perl5Util util = new Perl5Util();

        if (!GenericValidator.isBlankOrNull(value)) {
            if ((!util.match(
                        "/( )|(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)|(^_+@)|(^\\-+@)/",
                        value)) &&
                    util.match(
                        "/^[\\w\\'\\.\\-]+@((\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)|[a-zA-Z0-9\\-]{2,})$/",
                        value)) {
                return true;
            } else {
                try {
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

     */
    private Map getPackageInfo()
    {
        TreeMap allPackages = new TreeMap();
        TreeMap allClasses = new TreeMap();
        Perl5Util perl = new Perl5Util();

        Enumeration packages = packageManager.getPackageTypes();
        while ( packages.hasMoreElements() )
        {
            PackageType pkg = (PackageType) packages.nextElement();
            String pkgName = pkg.getName();
            String pkgDir = perl.substitute( "s/\\./\\//g", pkgName );
            String rootRef = perl.substitute( "s/[^\\.]*(\\.|$)/..\\//g", pkgName );

            // special case for the default package
            // javadoc doesn't deal with it, but it's easy for us
            if ( pkgName.length() == 0 )
            {
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    if(pvPhone == null) return true;

    final String phoneNumber = ((String) pvPhone).trim().toLowerCase();
    final String country = pvCountry == null ? "us" : ((String) pvCountry).trim().toLowerCase();

    return (new Perl5Util()).match(ValidationUtil.isValidUsaStateAbbr(country) ? ValidationUtil.US_PHONE_REGEXP
        : ValidationUtil.INTNL_PHONE_REGEXP, phoneNumber);
  }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

  }

  @Override
  public boolean isValid(String value, ConstraintValidatorContext context) {
    if(value == null) return true;
    return (value.length() < 9) ? false : (new Perl5Util()).match(ValidationUtil.SSN_REGEXP, StringUtils.strip(value));
  }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    final String postalCode = ((String) pvPostalCode).trim().toLowerCase();
    final String country = pvCountry == null ? "us" : ((String) pvCountry).trim().toLowerCase();

    if(ValidationUtil.isValidUsaStateAbbr(country)) {
      return (new Perl5Util()).match(ValidationUtil.US_ZIPCODE_REGEXP, postalCode);
    }

    // currently no validation for internation postal codes
    return true;
  }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    if(pvPhone == null) return true;

    final String phoneNumber = ((String) pvPhone).trim().toLowerCase();
    final String country = pvCountry == null ? "us" : ((String) pvCountry).trim().toLowerCase();

    return (new Perl5Util()).match(ValidationUtil.isValidUsaStateAbbr(country) ? ValidationUtil.US_PHONE_REGEXP
        : ValidationUtil.INTNL_PHONE_REGEXP, phoneNumber);
  }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    // no-op
  }

  public boolean isValid(String value, ConstraintValidatorContext context) {
    if(value == null) return true;
    return (value.length() < 9) ? false : (new Perl5Util()).match(ValidationUtil.SSN_REGEXP, StringUtils.strip(value));
  }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    final String postalCode = ((String) pvPostalCode).trim().toLowerCase();
    final String country = pvCountry == null ? "us" : ((String) pvCountry).trim().toLowerCase();

    if(ValidationUtil.isValidUsaStateAbbr(country)) {
      return (new Perl5Util()).match(ValidationUtil.US_ZIPCODE_REGEXP, postalCode);
    }

    // currently no validation for internation postal codes
    return true;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.