Watch
2
0
Fork
You've already forked jvindicator
0
HTTP servlet parameter validation
  • Java 93%
  • Shell 6.8%
  • CSS 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mark Raynsford 3e3f76e81e
Some checks are pending
main-RHEL10-x86_64-jdk25 / Build (push) Waiting to run
main-RHEL10-x86_64-jdk26 / Build (push) Waiting to run
main-RHEL9-x86_64-jdk25 / Build (push) Waiting to run
main-RHEL9-x86_64-jdk26 / Build (push) Waiting to run
Update workflows.
2026-07-31 18:42:57 +01:00
.forgejo Update workflows. 2026-07-31 18:42:57 +01:00
com.io7m.jvindicator.core Begin next development iteration. 2024-05-11 10:14:31 +00:00
com.io7m.jvindicator.tests Use junit BOM. 2024-09-29 20:34:44 +00:00
src/site/resources Update site metadata. 2025-08-09 15:07:07 +00:00
.gitignore Update .gitignore. 2024-05-07 16:01:45 +00:00
.gitmodules Move to new organization. 2024-05-01 19:32:45 +00:00
checkstyle-filter.xml Initial version. 2022-10-03 18:59:24 +00:00
checkstyle-suppressions-1.0.dtd Initial version. 2022-10-03 18:59:24 +00:00
doc7m-books.json Add doc7m-books.json 2026-07-31 18:36:48 +01:00
pom.xml Migrate project. 2026-06-27 10:11:56 +01:00
README-CHANGES.xml Mark release 1.0.0 2024-05-11 10:14:24 +00:00
README-LICENSE.txt Update LICENSE 2023-08-13 21:16:13 +00:00
README.in Migrate project. 2026-06-27 10:11:56 +01:00
README.md Migrate project. 2026-06-27 10:11:56 +01:00

jvindicator

Maven Central Maven Central (snapshot) Java Version

com.io7m.jvindicator

jvindicator

Trivial parameter validation functions intended for use in HTTP servlet applications.

Features

  • Type-safe parameter validation.
  • Written in pure Java 21.
  • OSGi ready.
  • JPMS ready.
  • ISC license.
  • High-coverage automated test suite.

Usage

Use the Vindicator class to build a validator, and then call check(). After calling check(), parameters can be inspected in a type-safe manner:

final var v =
  Vindication.start();
final var p0 =
  v.addRequiredParameter("u0", Vindication.integerUnsigned());
final var p1 =
  v.addRequiredParameter("u1", Vindication.integerUnsignedLong());
final var p2 =
  v.addRequiredParameter("s0", Vindication.integerSigned());
final var p3 =
  v.addRequiredParameter("s1", Vindication.integerSignedLong());
final var p4 =
  v.addRequiredParameter("i0", Vindication.integerBig());

v.check(Map.ofEntries(
  Map.entry("u0", new String[]{"23"}),
  Map.entry("u1", new String[]{"24"}),
  Map.entry("s0", new String[]{"-23"}),
  Map.entry("s1", new String[]{"-24"}),
  Map.entry("i0", new String[]{"-4703919738795935661825"})
));

assertEquals(23, p0.get());
assertEquals(24L, p1.get());
assertEquals(-23, p2.get());
assertEquals(-24L, p3.get());
assertEquals(new BigInteger("-4703919738795935661825"), p4.get());