aaron-kumar / vefa-validator

Generic validator originally created for use within eProcurement.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven Central Docker

VEFA Validator 2.x

Features

  • Very easy to use.
  • Supports rendering documents.
  • Very low footprint in your code.
  • Pooling of resources.
  • Supports different lifecycles of validation artifacts.
  • Configurable to fit multiple sizes.

Getting started

Include dependency in your pom.xml:

<dependency>
  <groupId>no.difi.vefa</groupId>
  <artifactId>validator-core</artifactId>
  <version>2.1.0</version>
</dependency>

Start validating business documents:

// Create a new validator using validation artifacts from DFØ.
Validator validator = ValidatorBuilder.newValidator().build();

// Validate business document.
Validation validation = validator.validate(Paths.get("/path/to/document.xml"));

// Print result of validation.
System.out.println(validation.getReport().getFlag());

The validator is expensive to create, one instance should be enough.

New repositories

Repositories referenced in the code was moved as of September 1st 2020. To switch to the new repository, adding source in the ValidatorBuilder is required. Example of how it may look like:

Validator validator = ValidatorBuilder.newValidator()
    .setSource(RepositorySource.of("https://anskaffelser.dev/repo/validator/current/"))
    .build();

More information on the change and link to the new test repository may be found in the announcment of the new repositories.

About

Generic validator originally created for use within eProcurement.


Languages

Language:Java 96.5%Language:XSLT 2.8%Language:Dockerfile 0.5%Language:Makefile 0.2%Language:Shell 0.0%