class Validation {
    /**
     * Adds all necessary input validation attributes to the given input element for the given data type and field.
     * @param {*} input An input element.
     * @param {string} type The data type (see DataManager types).
     * @param {string} field The field name for which to add validation attributes.
     */
    static addAttributes(input, type, field) {
        //Do nothing if no attribute set was given by the server.
        if (!validationAttributesByTypeAndField || !(type in validationAttributesByTypeAndField)) {
            return;
        }

        //Do nothing if no attributes were given for this field.
        if (!(field in validationAttributesByTypeAndField[type])) {
            return;
        }

        //Go through all attributes for given type and field.
        for (const attribute in validationAttributesByTypeAndField[type][field]) {
            //Apply attribute to input.
            input.setAttribute(attribute, validationAttributesByTypeAndField[type][field][attribute]);
        }
    }
}