// Path: src/main/java/com/michaelfotiadis/validator/annotated/model/ValidationResult.java
// public class ValidationResult {
// 
//     private final ValidationStatus status;
// 
//     public ValidationResult(final ValidationStatus status) {
//         this.status = status;
//     }
// 
//     public ValidationResult(final boolean isValid) {
//         if (isValid) {
//             this.status = ValidationStatus.SUCCESS;
//         } else {
//             this.status = ValidationStatus.UNDEFINED_FAILURE;
//         }
//     }
// 
//     /**
//      * Static factory
//      *
//      * @return successful {@link ValidationResult}
//      */
//     public static ValidationResult success() {
//         return new ValidationResult(ValidationStatus.SUCCESS);
//     }
// 
//     /**
//      * Static factory
//      *
//      * @return failed {@link ValidationResult}
//      */
//     public static ValidationResult failure() {
//         return new ValidationResult(ValidationStatus.UNDEFINED_FAILURE);
//     }
// 
//     /**
//      * Static factory
//      *
//      * @return null max {@link ValidationResult}
//      */
//     public static ValidationResult nullValue() {
//         return new ValidationResult(ValidationStatus.NULL_VALUE);
//     }
// 
//     public ValidationStatus getStatus() {
//         return this.status;
//     }
// 
//     public boolean isValid() {
//         return this.status == ValidationStatus.SUCCESS;
//     }
// 
// }
// 
// Path: src/main/java/com/michaelfotiadis/validator/annotated/model/ValidationStatus.java
// public enum ValidationStatus {
// 
//     UNDEFINED_FAILURE,
//     NULL_VALUE,
//     EMPTY_COLLECTION,
//     COLLECTION_CONTAINS_NULL,
//     PATTERN_DID_NOT_MATCH,
//     EMPTY_STRING,
//     INVALID_VALUE,
//     WRONG_TYPE_ARGUMENTS,
//     VALUE_OUT_OF_RANGE,
//     NUMBER_OUT_OF_RANGE,
//     INTEGER_OUT_OF_RANGE,
//     BYTE_OUT_OF_RANGE,
//     DOUBLE_OUT_OF_RANGE,
//     FLOAT_OUT_OF_RANGE,
//     EXCEPTION,
//     SUCCESS
// 
// }
// 
// Path: src/main/java/com/michaelfotiadis/validator/annotated/validators/Validator.java
// public interface Validator<T> {
// 
//     ValidationResult validate(T item, Annotation annotation);
// 
// }


import com.michaelfotiadis.validator.annotated.annotations.text.TextDateFormat;
import com.michaelfotiadis.validator.annotated.annotations.text.TextEmail;
import com.michaelfotiadis.validator.annotated.annotations.text.TextExactLength;
import com.michaelfotiadis.validator.annotated.annotations.text.TextIsNumeric;
import com.michaelfotiadis.validator.annotated.annotations.text.TextMatchesExpression;
import com.michaelfotiadis.validator.annotated.annotations.text.TextMaxLength;
import com.michaelfotiadis.validator.annotated.annotations.text.TextMinLength;
import com.michaelfotiadis.validator.annotated.annotations.text.TextNotNullOrEmpty;
import com.michaelfotiadis.validator.annotated.annotations.text.TextUrl;
import com.michaelfotiadis.validator.annotated.model.ValidationResult;
import com.michaelfotiadis.validator.annotated.model.ValidationStatus;
import com.michaelfotiadis.validator.annotated.validators.Validator;
import java.lang.annotation.Annotation;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Pattern;
        } else if (type.equals(TextEmail.class)) {
            return handleEmail(value);
        } else if (type.equals(TextUrl.class)) {
            return handleUrl(value);
        } else if (type.equals(TextMatchesExpression.class)) {
            return handleMatchesExpression(value, ((TextMatchesExpression) annotation).expression());
        } else if (type.equals(TextExactLength.class)) {
            return handleExactLength(value, ((TextExactLength) annotation).value());
        } else if (type.equals(TextMinLength.class)) {
            return handleMinLength(value, ((TextMinLength) annotation).value());
        } else if (type.equals(TextMaxLength.class)) {
            return handleMaxLength(value, ((TextMaxLength) annotation).value());
        } else if (type.equals(TextIsNumeric.class)) {
            return handleIsNumeric(value);
        } else if (type.equals(TextDateFormat.class)) {
            return handleIsOfDateFormat(value, ((TextDateFormat) annotation).value());
        } else {
            return ValidationResult.failure();
        }

    }

    private static ValidationResult handleMatchesExpression(final String value, final String expression) {

        final ValidationResult notEmptyResult = handleNotNullOrEmpty(value);
        if (notEmptyResult.isValid()) {

            if (Pattern.compile(expression).matcher(value).matches()) {
                return ValidationResult.success();
            } else {
// Path: src/main/java/com/michaelfotiadis/validator/annotated/model/ValidationResult.java
// public class ValidationResult {
// 
//     private final ValidationStatus status;
// 
//     public ValidationResult(final ValidationStatus status) {
//         this.status = status;
//     }
// 
//     public ValidationResult(final boolean isValid) {
//         if (isValid) {
//             this.status = ValidationStatus.SUCCESS;
//         } else {
//             this.status = ValidationStatus.UNDEFINED_FAILURE;
//         }
//     }
// 
//     /**
//      * Static factory
//      *
//      * @return successful {@link ValidationResult}
//      */
//     public static ValidationResult success() {
//         return new ValidationResult(ValidationStatus.SUCCESS);
//     }
// 
//     /**
//      * Static factory
//      *
//      * @return failed {@link ValidationResult}
//      */
//     public static ValidationResult failure() {
//         return new ValidationResult(ValidationStatus.UNDEFINED_FAILURE);
//     }
// 
//     /**
//      * Static factory
//      *
//      * @return null max {@link ValidationResult}
//      */
//     public static ValidationResult nullValue() {
//         return new ValidationResult(ValidationStatus.NULL_VALUE);
//     }
// 
//     public ValidationStatus getStatus() {
//         return this.status;
//     }
// 
//     public boolean isValid() {
//         return this.status == ValidationStatus.SUCCESS;
//     }
// 
// }
// 
// Path: src/main/java/com/michaelfotiadis/validator/annotated/model/ValidationStatus.java
// public enum ValidationStatus {
// 
//     UNDEFINED_FAILURE,
//     NULL_VALUE,
//     EMPTY_COLLECTION,
//     COLLECTION_CONTAINS_NULL,
//     PATTERN_DID_NOT_MATCH,
//     EMPTY_STRING,
//     INVALID_VALUE,
//     WRONG_TYPE_ARGUMENTS,
//     VALUE_OUT_OF_RANGE,
//     NUMBER_OUT_OF_RANGE,
//     INTEGER_OUT_OF_RANGE,
//     BYTE_OUT_OF_RANGE,
//     DOUBLE_OUT_OF_RANGE,
//     FLOAT_OUT_OF_RANGE,
//     EXCEPTION,
//     SUCCESS
// 
// }
// 
// Path: src/main/java/com/michaelfotiadis/validator/annotated/validators/Validator.java
// public interface Validator<T> {
// 
//     ValidationResult validate(T item, Annotation annotation);
// 
// }


// Path: src/main/java/com/michaelfotiadis/validator/annotated/validators/text/StringValidator.java
import com.michaelfotiadis.validator.annotated.annotations.text.TextDateFormat;
import com.michaelfotiadis.validator.annotated.annotations.text.TextEmail;
import com.michaelfotiadis.validator.annotated.annotations.text.TextExactLength;
import com.michaelfotiadis.validator.annotated.annotations.text.TextIsNumeric;
import com.michaelfotiadis.validator.annotated.annotations.text.TextMatchesExpression;
import com.michaelfotiadis.validator.annotated.annotations.text.TextMaxLength;
import com.michaelfotiadis.validator.annotated.annotations.text.TextMinLength;
import com.michaelfotiadis.validator.annotated.annotations.text.TextNotNullOrEmpty;
import com.michaelfotiadis.validator.annotated.annotations.text.TextUrl;
import com.michaelfotiadis.validator.annotated.model.ValidationResult;
import com.michaelfotiadis.validator.annotated.model.ValidationStatus;
import com.michaelfotiadis.validator.annotated.validators.Validator;
import java.lang.annotation.Annotation;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Pattern;

        } else if (type.equals(TextEmail.class)) {
            return handleEmail(value);
        } else if (type.equals(TextUrl.class)) {
            return handleUrl(value);
        } else if (type.equals(TextMatchesExpression.class)) {
            return handleMatchesExpression(value, ((TextMatchesExpression) annotation).expression());
        } else if (type.equals(TextExactLength.class)) {
            return handleExactLength(value, ((TextExactLength) annotation).value());
        } else if (type.equals(TextMinLength.class)) {
            return handleMinLength(value, ((TextMinLength) annotation).value());
        } else if (type.equals(TextMaxLength.class)) {
            return handleMaxLength(value, ((TextMaxLength) annotation).value());
        } else if (type.equals(TextIsNumeric.class)) {
            return handleIsNumeric(value);
        } else if (type.equals(TextDateFormat.class)) {
            return handleIsOfDateFormat(value, ((TextDateFormat) annotation).value());
        } else {
            return ValidationResult.failure();
        }

    }

    private static ValidationResult handleMatchesExpression(final String value, final String expression) {

        final ValidationResult notEmptyResult = handleNotNullOrEmpty(value);
        if (notEmptyResult.isValid()) {

            if (Pattern.compile(expression).matcher(value).matches()) {
                return ValidationResult.success();
            } else {
                return new ValidationResult(ValidationStatus.PATTERN_DID_NOT_MATCH);