Skip to content

Quick Reference: Core

Patrick Moawad edited this page Oct 22, 2013 · 16 revisions

This page gives a quick overview and description of all entities of the ValidationFramework.

Triggers

Triggers start the validation process when validation is needed.

Here is a list of all concrete triggers available in the validationframework-core module:

Trigger Description
AbstractTrigger Convenient base class that can be used for any trigger.
ManualTrigger Triggered upon call to fireTriggerEvent().
PropertyChangeTrigger Implementing the PropertyChangeListener ins, triggered whenever the registered properties change.
ResultCollector Triggered whenever it processes the result of another validator.

Data providers

Data provides retrieve the data to be validation the triggers are initiated.

Here is a list of all concrete data providers available in the validationframework-core module:

Data provider Output Description
ListCompositeDataProvider List<DPO> Provides a list of output from wrapped data providers.
MapCompositeDataProvider Map<K, DPO> Provides a map of output from wrapped data providers associated with keys.
ResultCollector <RHI> Provides the result of a previously triggered validation.
TransformedDataProvider <TDPO> Transforms the output of a wrapped data provider.

Rules

Rules validate the data from the data providers and produce results.

Here is a list of all concrete rules available in the validationframework-core modules:

Rule Input Output Description
AggregatorRule Collection<RI> <RO>
AndBooleanRule Collection<Boolean> Boolean
AndCompositeBooleanRule <RI> Boolean
EqualsRule <RI> Boolean Checks whether the input object is equal to a specified object.
NegateBooleanRule <RI> Boolean Negates the boolean result of a wrapped rule.
NotNullBooleanRule Object Boolean
NullBooleanRule Object Boolean
NumberEqualToRule Number Boolean
NumberGreaterThanOrEqualToRule Number Boolean
NumberGreaterThanRule Number Boolean
NumberLessThanOrEqualToRule Number Boolean
NumberLessThanRule Number Boolean
OrBooleanRule Collection<Boolean> Boolean
OrCompositeBooleanRule <RI> Boolean
StringLengthEqualToRule String Boolean
StringLengthGreaterThanOrEqualToRule String Boolean
StringLengthGreaterThanRule String Boolean
StringLengthLessThanOrEqualToRule String Boolean
StringLengthLessThanRule String Boolean
StringNotEmptyRule String Boolean Makes sure the input string is not empty.
StringRegexRule String Boolean
TransformerRule <RI> <RO>

Result handlers

Result handlers process the results of the rules.

Here is a list of all concrete result handlers available in the validationframework-core and validationframework-swing modules:

Result handler Input Description
CompositeResultHandler <RHI>
PrintStreamResultHandler <RHI>
ResultCollector <RHI>
SimpleResultCollector <RHI>
TransformedResultHandler <RHI> Transforms the result and delegates its handling to a wrapped result handler.

Validators

Validators glue all triggers, data providers, rules and result handlers together.

Here is a list of all concrete validators available in the validationframework-core module:

Validator Data provider output Rule input Rule output Result handler input Description
AndSimpleValidator <DPO> <DPO> Boolean Boolean Upon any trigger, each data provider will be used, each piece of data retrieved will be checked against all rules, all boolean results will be combined using the AND operator, and the combined result will be processed by all result handlers.
DefaultMappableValidator <DPO> <DPO> <RO> <RO> Upon any trigger, each data provider mapped to the initiated trigger will be used, each piece of data retrieved will be checked against each rule mapped to the data providers, each result will be processed by all result handlers mapped to the rules.
DefaultSimpleValidator <DPO> <DPO> <RO> <RO> Upon any trigger, each data providers will be used, each piece of data retrieved will be checked against each rule, each result will be processed by each result handler.
OrSimpleValidator <DPO> <DPO> Boolean Boolean Upon any trigger, all data providers will be used, all retrieved data will be checked against all rules, all boolean results will be combined using the AND operator, and the combined result will be processed by all result handlers.
ResultAggregationValidator <DPO> <DPO> <RO> <RHI> Upon any trigger, all data providers will be used, all retrieved data will be checked against all rules, all results will be combined using a specified aggregator (transformer), and the aggregated result will be processed by all result handlers.
ResultCollectorValidator <DPO> <DPO> <RO> <RO> Upon any trigger and any result produced by the rules collected from other validators, all data providers will used (including the result collectors giving the results from the other validators), all provided data will be gather into a collection and passed to all the rules, all results will be processed by all result handlers.
GeneralValidator <DPO> <RI> <RO> <RHI> All-purpose validator doing all the above and allowing to transform the data providers output, rules input, rules output and results handler input.

Transformers

Transformers can be used in some data providers, rules, result handlers and validators to convert or aggregate the manipulated data.

Here is a list of all concrete transformers available in the validationframework-core module:

Transformer Input Output Description
AndBooleanAggregator Collection<Boolean> Boolean Performs the AND operation with all input booleans of the collection.
CastTranformer <I> <O> Casts the input of type <I> to <O>.
CollectionElementTransformer Collection<I> Collection<O> Transforms each element of the input collection using a specified element transformer.
NegateBooleanTransformer Boolean Boolean Negates the input boolean.
OrBooleanAggregator Collection<Boolean> Boolean Performs the OR operation with all input booleans of the collection.
ToStringTransformer <I> String Uses the toString() method of the input object of type <I>.
Clone this wiki locally