-
Notifications
You must be signed in to change notification settings - Fork 5
Home
The ValidationFramework is a simple and flexible framework mainly (but not strictly) designed to validate user input and provide appropriate feedback. Currently supporting Swing and (partially) JavaFX by default, it can be easily extended for other purposes and frameworks.
This page gives some general information about the project.
Most of Java validation frameworks and engines available on the internet have at least one of the following caveats:
- They are very simple to use, but not flexible enough: their limit is quickly reached;
- They are very flexible, but tend to be complex to use: they require a lot of configuration and/or code to be written to achieve goals;
- They do not cover the whole process of validation, from the moment it is triggered till the end processing of the results;
- They are not free and/or open-source, or their license is not permissive enough to integrate with other projects and to be used in commercial products.
The ValidationFramework is meant to overcome all these issues. The ultimate goal is to be very flexible, and yet very easy and ready to use, to cover the whole validation process from A to Z, and to be available under a permissive license.
The ValidationFramework is a set of base classes, interfaces and utilities to help in implementing full-featured validation in Java. Although it is mainly targeted for validation of user input, it can be applied to other domains as well.
The ValidationFramework provides facilities to implement the complete validation process from the moment it is triggered, till the processing of the validation result(s). It is based on the following five concepts:
- Triggers: they trigger the whole validation process (for instance, whenever the user presses a key, whenever some data needs to be stored in a database, etc.);
- Data Providers: they read, gather and provide the data to be validated whenever the validation process is triggered (for instance, reading a value from an input field, retrieving some data from a database, etc.);
- Rules: they validate the data provided by the data providers (for instance, checking the length of a string, checking that some data is of a specific type, checking that a value is within a specific range, checking that an XML string matches an XSD schema, etc.) and produce validation results (for instance, string too long, value valid, value invalid, value out of range, parse error at a specific line, etc.);
- Result Handlers: they perform some action based on the validation results produced by the rules (for instance, giving feedback to the user by showing an error dialog, enabling/disabling some components, logging errors, connecting to a server, etc.).
- Validators: they glue everything together.
Additionally, the ValidationFramework provides the following concepts:
- Properties: they are observable values, sets, lists and maps that can be used in a binding mechanism to help in implementing dynamic conditional logic (for instance, enabling/disabling components whenever some properties change, changing the value of components based on some other properties, etc.).
- Transformers: they transform data on-demand (for instance, casting, calling toString(), unit conversion, etc.), and can be used to transform the input and/or output of data providers, rules, result handlers and properties.
- Quick Start
- Properties and Binding
- Javadoc: see Javadoc comments in source code
- Other Wiki pages
- Wiki: https://github.com/padrig64/ValidationFramework/wiki
- Source code: https://github.com/padrig64/ValidationFramework/
- Snapshot artifacts in Sonatype OSS Maven Repository: https://oss.sonatype.org/content/groups/public/com/google/code/validationframework/
- Released artifacts in Maven Central: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.google.code.validationframework%22
The ValidationFramework is provided under the Simplified BSD License (2-clause).