<commit_before>package gov.nih.nci.cabig.caaers.web.fields;

import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.AUTOCOMPLETER;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.DATE;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.LONGSELECT;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.SELECT;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.TEXT;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.*;
import gov.nih.nci.cabig.caaers.web.fields.validators.FieldValidator;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;

/**
 * @author <NAME>
 */
public class InputFieldFactory {
    private static final boolean DEFAULT_REQUIREDNESS = false;

    private static final String DEFAULT_TRUE_DISPLAY = "Yes";

    private static final String DEFAULT_FALSE_DISPLAY = "No";

    private static final FieldValidator[] EMPTY_VALIDATORS = new FieldValidator[0];

    private InputFieldFactory() {
    }
    
    public static InputField createInputField(InputField.Category category, String propertyName, String displayName,
            FieldValidator... validators) {
    	return new DefaultInputField(category, propertyName, displayName, validators);
    }
    public static InputField createInputField(InputField.Category category, String propertyName, String displayName,
            boolean required) {
    	return new DefaultInputField(category, propertyName, displayName, required);
    }

    public static InputField createTextField(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(TEXT, propertyName, displayName, validators);
    }

    public static InputField createTextField(String propertyName, String displayName,
                    boolean required) {
        return  createInputField(TEXT, propertyName, displayName, required);
    }

    public static InputField createDateField(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(DATE, propertyName, displayName, validators);
    }

    public static InputField createDateField(String propertyName, String displayName,
                    boolean required) {
        return createInputField(DATE, propertyName, displayName, required);
    }

    public static InputField createTextArea(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(TEXTAREA, propertyName, displayName, validators);
    }

    public static InputField createTextArea(String propertyName, String displayName,
                    boolean required) {
        return createInputField(TEXTAREA, propertyName, displayName, required);
    }

    public static InputField createAutocompleterField(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(AUTOCOMPLETER, propertyName, displayName, validators);
    }

    public static InputField createAutocompleterField(String propertyName, String displayName,
                    boolean required) {
        return createInputField(AUTOCOMPLETER, propertyName, displayName, required);
    }
    
    

    public static InputField createSelectField(String propertyName, String displayName,
                    Map<Object, Object> options, FieldValidator... validators) {
        DefaultInputField select = new DefaultInputField(SELECT, propertyName, displayName,
                        validators);
        InputFieldAttributes.setOptions(select, options);
        return select;
    }
<commit_msg>Inplace editor JIRA ID : CAAERS-221<commit_after>package gov.nih.nci.cabig.caaers.web.fields;

import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.AUTOCOMPLETER;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.DATE;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.LONGSELECT;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.SELECT;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.TEXT;
import static gov.nih.nci.cabig.caaers.web.fields.InputField.Category.*;
import gov.nih.nci.cabig.caaers.web.fields.validators.FieldValidator;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;

/**
 * @author <NAME>
 */
public class InputFieldFactory {
    private static final boolean DEFAULT_REQUIREDNESS = false;

    private static final String DEFAULT_TRUE_DISPLAY = "Yes";

    private static final String DEFAULT_FALSE_DISPLAY = "No";

    private static final FieldValidator[] EMPTY_VALIDATORS = new FieldValidator[0];

    private InputFieldFactory() {
    }
    
    public static InputField createInputField(InputField.Category category, String propertyName, String displayName,
            FieldValidator... validators) {
    	return new DefaultInputField(category, propertyName, displayName, validators);
    }
    public static InputField createInputField(InputField.Category category, String propertyName, String displayName,
            boolean required) {
    	return new DefaultInputField(category, propertyName, displayName, required);
    }

    public static InputField createTextField(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(TEXT, propertyName, displayName, validators);
    }

    public static InputField createTextField(String propertyName, String displayName,
                    boolean required) {
        return  createInputField(TEXT, propertyName, displayName, required);
    }

    public static InputField createDateField(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(DATE, propertyName, displayName, validators);
    }

    public static InputField createDateField(String propertyName, String displayName,
                    boolean required) {
        return createInputField(DATE, propertyName, displayName, required);
    }

    public static InputField createTextArea(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(TEXTAREA, propertyName, displayName, validators);
    }

    public static InputField createTextArea(String propertyName, String displayName,
                    boolean required) {
        return createInputField(TEXTAREA, propertyName, displayName, required);
    }

    public static InputField createAutocompleterField(String propertyName, String displayName,
                    FieldValidator... validators) {
        return createInputField(AUTOCOMPLETER, propertyName, displayName, validators);
    }

    public static InputField createAutocompleterField(String propertyName, String displayName,
                    boolean required) {
        return createInputField(AUTOCOMPLETER, propertyName, displayName, required);
    }
    
    public static InputField createInplaceTextEditorField(String propertyName, String displayName, boolean required){
    	return createInputField(INPLACE_TEXT, propertyName, displayName, required);
    }
    
    public static InputField createInplaceTextEditorField(String propertyName, String displayName, FieldValidator... validators){
    	return createInputField(INPLACE_TEXT, propertyName, displayName, validators);
    }

    public static InputField createSelectField(String propertyName, String displayName,
                    Map<Object, Object> options, FieldValidator... validators) {
        DefaultInputField select = new DefaultInputField(SELECT, propertyName, displayName,
                        validators);
        InputFieldAttributes.setOptions(select, options);
        return select;
    }

{'fraction_non_alphanumeric': 0.07564165844027641, 'fraction_numerical': 0.0006169792694965449, 'mean_word_length': 3.6314285714285712, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3144844', 'n_tokens_mistral': 2097, 'n_tokens_neox': 2058, 'n_words': 498}