コード例 #1
0
ファイル: PUDQuery.java プロジェクト: tifoha/openeplatform
  @Override
  public void populate(XMLParser xmlParser) throws ValidationException {

    List<ValidationError> errors = new ArrayList<ValidationError>();

    description =
        XMLValidationUtils.validateParameter(
            "description", xmlParser, false, 1, 65535, StringPopulator.getPopulator(), errors);
    helpText =
        XMLValidationUtils.validateParameter(
            "helpText", xmlParser, false, 1, 65535, StringPopulator.getPopulator(), errors);

    XMLParser serviceParser = xmlParser.getNode("AllowedSearchServices");

    if (serviceParser != null) {

      allowedSearchServices =
          XMLValidationUtils.validateParameters(
              "allowedSearchService",
              serviceParser,
              false,
              PUDQueryCRUD.SEARCH_SERVICE_POPULATOR,
              errors);
    }

    if (!errors.isEmpty()) {

      throw new ValidationException(errors);
    }
  }
コード例 #2
0
  @Override
  public void populate(XMLParser xmlParser) throws ValidationException {

    List<ValidationError> errors = new ArrayList<ValidationError>();

    description =
        XMLValidationUtils.validateParameter(
            "description", xmlParser, false, 1, 65535, StringPopulator.getPopulator(), errors);
    helpText =
        XMLValidationUtils.validateParameter(
            "helpText", xmlParser, false, 1, 65535, StringPopulator.getPopulator(), errors);
    maxParties = xmlParser.getInteger("maxParties");

    if (!errors.isEmpty()) {

      throw new ValidationException(errors);
    }
  }
コード例 #3
0
  public static String validateParameter(
      String fieldName,
      HttpServletRequest req,
      boolean required,
      Integer minLength,
      Integer maxLength,
      Collection<ValidationError> errors) {

    return validateParameter(
        fieldName, req, required, minLength, maxLength, StringPopulator.getPopulator(), errors);
  }