Skip to content

Commit

Permalink
Preparations for the headless-form-module
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Lemke committed Sep 29, 2021
1 parent b6f2bcc commit 690edc8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* Custom additional FormElements and Validators might be added to the classPath as well and will be handled if they are
* placed in the {@link com.tallence.formeditor.elements} or {@link com.tallence.formeditor.validator} packages.
* For elements and validators outside this package, you will have to define your own {@link ProvidesTypeNameResolver}
* For elements and validators outside this package, you will have to add these types in your custom {@link ProvidesTypeNameResolver}.
*/
@Configuration(proxyBeanMethods = false)
@Import(value = {MultiSiteConfiguration.class,})
Expand Down Expand Up @@ -70,7 +70,6 @@ public ProvidesTypeNameResolver providesFormValidatorTypeNameResolver() {
.map(Class::getSimpleName)
.collect(toCollection(ArrayList::new));
validatorTypes.add(Validator.class.getSimpleName());
validatorTypes.add("SizeValidator");

return name -> validatorTypes.contains(name) ? Optional.of(true): Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Validator for elements of type {@link CheckBoxesGroup}
*/
public class CheckBoxesGroupValidator implements Validator<List>, SizeValidator {
public class CheckBoxesGroupValidator implements SizeValidator<List> {

private static final String MESSAGE_KEY_CHECKBOX_REQUIRED = "com.tallence.forms.checkboxes.empty";
private static final String MESSAGE_KEY_CHECKBOX_MIN = "com.tallence.forms.checkboxes.min";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Validator for elements of type {@link FileUpload}
*/
public class FileUploadValidator implements Validator<MultipartFile>, SizeValidator {
public class FileUploadValidator implements SizeValidator<MultipartFile> {

private static final String MESSAGE_KEY_FILEUPLOAD_REQUIRED = "com.tallence.forms.fileupload.empty";
private static final String MESSAGE_KEY_FILEUPLOAD_MIN = "com.tallence.forms.fileupload.min";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Validator for elements of type {@link com.tallence.formeditor.elements.NumberField}
*/
@ValidationMessage(name = "number", messageKey = MESSAGE_KEY_NUMBERFIELD_NAN)
public class NumberValidator implements Validator<String>, SizeValidator {
public class NumberValidator implements SizeValidator<String> {

static final String MESSAGE_KEY_NUMBERFIELD_MIN = "com.tallence.forms.numberfield.min";
static final String MESSAGE_KEY_NUMBERFIELD_MAX = "com.tallence.forms.numberfield.max";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Interface for validators with min- or maxSizes. e.g. {@link NumberValidator}
*
*/
public interface SizeValidator {
public interface SizeValidator<T> extends Validator<T> {

Integer getMinSize();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Validator for elements of type {@link com.tallence.formeditor.elements.TextArea} and
* {@link TextField}
*/
public class TextValidator implements Validator<String>, SizeValidator {
public class TextValidator implements SizeValidator<String> {

private static final String MESSAGE_KEY_TEXTFIELD_REQUIRED = "com.tallence.forms.textfield.empty";
private static final String MESSAGE_KEY_TEXTFIELD_MIN = "com.tallence.forms.textfield.min";
Expand Down

0 comments on commit 690edc8

Please sign in to comment.