Skip to main content

Welcome to Validator

Validator is a flexible and comprehensive Java library that simplifies string validation by allowing you to chain validation rules or use declarative annotations. Whether you’re validating form inputs, API requests, or user data, Validator provides an elegant solution with built-in support for common validation scenarios.

Quick Start

Get up and running with Validator in minutes

Installation

Add Validator to your Maven or Gradle project

API Reference

Explore the complete API documentation

View on GitHub

Check out the source code and contribute

Key Features

Fluent API

Chain validation rules with an intuitive builder pattern for readable, maintainable code

27+ Predefined Rules

Built-in validators for emails, URLs, dates, numbers, IP addresses, and more

Annotation Support

Use declarative annotations on your model fields for clean, framework-style validation

Custom Rules

Create your own validation logic with lambda expressions or rule objects

Error Handling

Choose between event-driven callbacks or exception-based error handling

Localization

Built-in support for English and Spanish with customizable messages

Quick Example

Here’s how easy it is to validate a string with Validator:
import io.github.ApamateSoft.validator.Validator;

Validator emailValidator = new Validator.Builder()
    .required()
    .email()
    .build();

if (emailValidator.isValid("[email protected]")) {
    // Valid email
}
Or use annotations for declarative validation:
import io.github.ApamateSoft.validator.annotations.*;

public class User {
    @Required
    @Email
    private String email;
    
    @Required
    @MinLength(min = 8)
    @MustContainMin(min = 1, condition = "0123456789")
    private String password;
}

Getting Started

1

Install the library

Add Validator to your project using Maven or GradleView installation instructions →
2

Create your first validator

Build a validator with predefined or custom rulesFollow the quickstart guide →
3

Explore advanced features

Learn about annotations, localization, and error handling patternsRead the guides →

Build docs developers (and LLMs) love