// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/fields/FormInput.java
// public interface FormInput<T> {
// 
//     void setOnInputChangedListener(OnInputChangedListener listener);
// 
//     void setError(ValidationError error);
// 
//     Class<T> getType();
//     T getValue();
//     void setValue(T value);
// 
//     ValidationError getError();
// }
// 
// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/validation/errors/ValidationError.java
// public interface ValidationError {
//     CharSequence getLocalizedMessage();
// }
// 
// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/validation/errors/ValidationErrorProvider.java
// public interface ValidationErrorProvider {
// 
//     ValidationError getValidationError( Class<? extends ValidationError> clazz, Object ... params);
// 
// }


import com.greengrowapps.ggaforms.fields.FormInput;
import com.greengrowapps.ggaforms.validation.errors.ValidationError;
import com.greengrowapps.ggaforms.validation.errors.ValidationErrorProvider;
package com.greengrowapps.ggaforms.validation.validator;


public abstract class ErrorProvidedValidator<T extends ValidationError> extends BaseValidator{

    ValidationErrorProvider errorProvider;

    public ErrorProvidedValidator(FormInput formInput, ValidationErrorProvider errorProvider){
        super(formInput);
        this.errorProvider = errorProvider;
    }

    @Override
    protected ValidationError getValidationError(Object value){
// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/fields/FormInput.java
// public interface FormInput<T> {
// 
//     void setOnInputChangedListener(OnInputChangedListener listener);
// 
//     void setError(ValidationError error);
// 
//     Class<T> getType();
//     T getValue();
//     void setValue(T value);
// 
//     ValidationError getError();
// }
// 
// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/validation/errors/ValidationError.java
// public interface ValidationError {
//     CharSequence getLocalizedMessage();
// }
// 
// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/validation/errors/ValidationErrorProvider.java
// public interface ValidationErrorProvider {
// 
//     ValidationError getValidationError( Class<? extends ValidationError> clazz, Object ... params);
// 
// }


// Path: GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/validation/validator/ErrorProvidedValidator.java
import com.greengrowapps.ggaforms.fields.FormInput;
import com.greengrowapps.ggaforms.validation.errors.ValidationError;
import com.greengrowapps.ggaforms.validation.errors.ValidationErrorProvider;

package com.greengrowapps.ggaforms.validation.validator;


public abstract class ErrorProvidedValidator<T extends ValidationError> extends BaseValidator{

    ValidationErrorProvider errorProvider;

    public ErrorProvidedValidator(FormInput formInput, ValidationErrorProvider errorProvider){
        super(formInput);
        this.errorProvider = errorProvider;
    }

    @Override
    protected ValidationError getValidationError(Object value){
        return errorProvider.getValidationError( getErrorClass() );