Java libraries for validating Excel-related workflows.
xcel-validation-core– core validation APIs and rulesxcel-validation-poi– Apache POI-based implementations
Each field maps to a header and a list of validators.
{
"fields": [
{
"fieldName": "Email",
"required": true
}
]
}{
"fields": [
{
"fieldName": "Count",
"dataType": "Integer"
}
]
}{
"fields": [
{
"fieldName": "Code",
"validators": [
{
"type": "regex",
"options": {
"pattern": "^[A-Z]{3}$"
}
}
]
}
]
}{
"fields": [
{
"fieldName": "Age",
"validators": [
{
"type": "range",
"options": {
"min": 10,
"max": 150
}
}
]
}
]
}{
"fields": [
{
"fieldName": "Name",
"validators": [
{
"type": "length",
"options": {
"min": 3,
"max": 50
}
}
]
}
]
}{
"fields": [
{
"fieldName": "Date",
"validators": [
{
"type": "dateTime",
"options": {
"format": "yyyy-MM-dd"
}
}
]
}
]
}{
"fields": [
{
"fieldName": "Status",
"validators": [
{
"type": "set",
"options": {
"values": [
"NEW",
"DONE"
]
}
}
]
}
]
}{
"fields": [
{
"fieldName": "Email",
"validators": [
{
"type": "unique"
}
]
}
]
}{
"fields": [
{
"fieldName": "Discount",
"validators": [
{
"type": "conditional",
"options": {
"mode": "all",
"conditions": [
{ "type": "dataType", "options": { "dataType": "Integer", "fieldName": "Age" } },
{ "type": "set", "options": { "values": ["VIP"], "fieldName": "Status" } }
],
"validators": [
{ "type": "range", "options": { "min": 1, "max": 10 } }
]
}
}
]
}
]
}{
"fields": [
{
"fieldName": "Age",
"required": true,
"dataType": "Integer",
"validators": [
{ "type": "range", "options": { "min": 1, "max": 150 } }
]
}
]
}- Java 17+
- Gradle (wrapper included)
./gradlew build
./gradlew test
For validators that keep per-run state (e.g., unique), the core uses a validation session
to avoid shared state across runs.
Core usage:
ValidationSession session = new CoreValidator().startSession(config);
List<ValidationError> errors = session.validateRow(rowMap, rowIndex);See CONTRIBUTING.md.
Apache License 2.0. See LICENSE.