Examples of ValidateException


Examples of cn.dreampie.common.exception.ValidateException

  @Override
  public boolean start() {
    properties = PropertiesUtils.me().loadPropertyFile(config);
    host = properties.getProperty("smtp.host", "");
    if (ValidateUtils.me().isNullOrEmpty(host)) {
      throw new ValidateException("email host has not found!");
    }
    port = properties.getProperty("smtp.port", "");

    ssl = properties.getProperty("smtp.ssl", "false");
    sslport = properties.getProperty("smtp.sslport", "");
//    if (Boolean.parseBoolean(ssl)) {
//      if (ValidateUtils.me().isNullOrEmpty(sslport)) {
//        throw new ValidateException("email ssl is true but sslport has not found!");
//      }
//    }
    timeout = properties.getProperty("smtp.timeout", "60000");
    tls = properties.getProperty("smtp.tls", "false");
    debug = properties.getProperty("smtp.debug", "false");
    user = properties.getProperty("smtp.user", "");

    if (ValidateUtils.me().isNullOrEmpty(user)) {
      throw new ValidateException("email user has not found!");
    }
    password = properties.getProperty("smtp.password", "");
    if (ValidateUtils.me().isNullOrEmpty(password)) {
      throw new ValidateException("email password has not found!");
    }

    name = properties.getProperty("smtp.name", "");

    from = properties.getProperty("smtp.from", "");
    if (ValidateUtils.me().isNullOrEmpty(from)) {
      throw new ValidateException("email from has not found!");
    }

    encode = properties.getProperty("smtp.encode", "UTF-8");
    mailerConf = new MailerConf(host, sslport, Integer.parseInt(timeout), port, Boolean.parseBoolean(ssl), Boolean.parseBoolean(tls), Boolean.parseBoolean(debug), user, password, name, from, encode);
View Full Code Here

Examples of com.et.ar.exception.ValidateException

            else{
                return true;
            }
        }
        catch(Exception e){
            throw new ValidateException(e);
        }
    }
View Full Code Here

Examples of com.et.ar.exception.ValidateException

            else{
                return true;
            }
        }
        catch(Exception e){
            throw new ValidateException(e);
        }
    }
View Full Code Here

Examples of com.et.ar.exception.ValidateException

        String msg = "";
        try{
            msg = (String)c.getMethod("message").invoke(parameters);
        }
        catch(Exception e){
            throw new ValidateException("cannot find message property for " + parameters.toString(), e);
        }
        if (validatorResource == null){
            return msg;
        }
       
        try{
            String resourceMsg = validatorResource.getString(msg.trim());
            msg = resourceMsg;
            for(Method method: c.getDeclaredMethods()){
                if (method.getParameterTypes().length == 0){
                    String key = "\\{"+method.getName()+"\\}";
                    String value = method.invoke(parameters).toString();
                    msg = msg.replaceAll(key, value);
                }
            }
        }
        catch(MissingResourceException e1){
            throw new ValidateException("cannot find validation resource.", e1);
        }
        catch(Exception e2){
            throw new ValidateException(e2);
        }
       
        return msg;
    }
View Full Code Here

Examples of com.et.ar.exception.ValidateException

                    if (ucv.validate(value) == false){
                        errors.add(ucv.getMessage());
                    }
                }
                catch(IllegalAccessException e){
                    throw new ValidateException(e);
                }
            }
        }
    }
View Full Code Here

Examples of com.et.ar.exception.ValidateException

                    if (uuv.validate(f.get(this)) == false){
                        errors.add(uuv.getMessage());
                    }
                }
                catch(Exception e){
                    throw new ValidateException(e);
                }
            }
        }
    }
View Full Code Here

Examples of com.et.ar.exception.ValidateException

                    }
                }
            }
        }
        catch(Exception e){
            throw new ValidateException(e);
        }
    }
View Full Code Here

Examples of com.jengine.orm.exception.ValidateException

    }

    public void validate(Model obj) throws ValidateException, DBException {
        Object value = getPersistenceValue(obj);
        if (required && value == null) {
            throw new ValidateException("'%s' field validation error: required field is empty");
        }
    }
View Full Code Here

Examples of de.mhus.lib.form.ValidateException

  public void setValue(String value) throws FormException {
    if (value == null)
      value = "";

    if (value.length() < min)
      throw new ValidateException(getTarget(), this, "min");
   
    if (max > 0 && value.length() > max)
      throw new ValidateException(getTarget(), this, "max");
   
    if ((this.value != null && !this.value.equals(value))
        || (value != null && !value.equals(this.value))) {
      this.value = value;
      setChanged(true);
View Full Code Here

Examples of de.mhus.lib.form.ValidateException

    if (value == null)
      value = "";

    Matcher matcher = pattern.matcher(value);
    if (!matcher.matches())
      throw new ValidateException(getTarget(), this, "format");
   
    super.setValue(value);
  }
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.