Package org.strecks.form.controller

Source Code of org.strecks.form.controller.FormTestUtils

package org.strecks.form.controller;

import org.apache.struts.action.ActionForm;
import org.strecks.bind.internal.BindAnnotationReader;
import org.strecks.bind.internal.BindConvertInfo;
import org.strecks.validator.internal.ValidationAnnotationReader;
import org.strecks.validator.internal.ValidationInfo;


/**
* @author Phil Zoio
*/
public class FormTestUtils
{

  public static DelegatingForm getDelegatingForm(ActionForm form)
  {
    BindAnnotationReader bindReader = new BindAnnotationReader();
    BindConvertInfo bindConvertInfo = bindReader.readBindables(form);
 
    DelegatingForm delegator = new DelegatingForm(form);
    delegator.setBindConvertInfo(bindConvertInfo);
   
    ValidationAnnotationReader reader = new ValidationAnnotationReader();
    ValidationInfo validatorMap = reader.readValidationHandlers(form, bindConvertInfo)
    delegator.setValidationInfo(validatorMap)
   
    return delegator;
  }

}
TOP

Related Classes of org.strecks.form.controller.FormTestUtils

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.