Package org.apache.commons.validator

Examples of org.apache.commons.validator.FormSet


    }
  }

  @SuppressWarnings("unchecked")
  public static void generateValidationJsFile(String basePath) throws IOException {
    FormSet formSet = null;
    try {
      java.lang.reflect.Field field = validatorResources.getClass().getDeclaredField(
          "defaultFormSet");
      field.setAccessible(true);
      formSet = (FormSet) field.get(validatorResources);
    } catch (SecurityException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (NoSuchFieldException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (IllegalArgumentException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    if (formSet != null) {
      Set<String> formNames = formSet.getForms().keySet();
      for (String formName : formNames) {
        File file = new File(basePath, formName + ".js");
        String js = generateValidationJs(formName);
        FileUtils.writeStringToFile(file, js);
      }
View Full Code Here

TOP

Related Classes of org.apache.commons.validator.FormSet

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.