-
Notifications
You must be signed in to change notification settings - Fork 5
Quick Reference: Core
This page gives a quick overview and description of all entities of the ValidationFramework.
Triggers start the validation process when validation is needed.
Here is a list of all concrete triggers available in the [validationframework-core] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) module:
Trigger | Description |
---|---|
AbstractTrigger | Convenient base class that can be used for any trigger. |
CompositeTrigger | Triggered whenever any of its embedded triggers are triggered. |
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 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] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) 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 validate the data from the data providers and produce results.
Here is a list of all concrete rules available in the [validationframework-core] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) module:
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 process the results of the rules.
Here is a list of all concrete result handlers available in the [validationframework-core] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) module:
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 glue all triggers, data providers, rules and result handlers together.
Here is a list of all concrete validators available in the [validationframework-core] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) 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. |
Properties can be used for many purposes, including the implementation of conditional logic.
Here is a list of all concrete properties available in the [validationframework-core] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) module:
Property | Read | Write | Description |
---|---|---|---|
AbstractReadableProperty | <R> | - | Convenient abstract implementation of readable property. |
AbstractReadableWritableProperty | <R> | <W> | Convenient abstract implementation of a property that is both readable and writable. |
CompositeReadableProperty | Collection<R> | - | Property encapsulating other readable properties having values of a same type. |
CompositeWritableProperty | - | <W> | Property encapsulating other writable properties having values of a same type. |
NegateBooleanPropertyWrapper | Boolean | - | Wrapper to negate a boolean property. |
ReadOnlyPropertyWrapper | <R> | - | Wrapper to make a property read-only. |
SimpleBooleanProperty | Boolean | Boolean | SimpleProperty having a Boolean value. |
SimpleByteProperty | Byte | Byte | SimpleProperty having a Byte value. |
SimpleCharacterProperty | Character | Character | SimpleProperty having a Character value. |
SimpleDoubleProperty | Double | Double | SimpleProperty having a Double value. |
SimpleFloatProperty | Float | Float | SimpleProperty having a Float value. |
SimpleFormatProperty | Format | Format | SimpleProperty having a Format value. |
SimpleIntegerProperty | Integer | Integer | SimpleProperty having an Integer value. |
SimpleLongProperty | Long | Long | SimpleProperty having a Long value. |
SimpleNumberProperty | Number | Number | SimpleProperty having a Number value. |
SimpleObjectProperty | Object | Object | SimpleProperty having an Object value. |
SimpleProperty | <T> | <T> | Simple implementation of a property that is both readable and writable. |
SimpleShortProperty | Short | Short | SimpleProperty having a Short value. |
SimpleStringProperty | String | String | SimpleProperty having a String value. |
Transformers can be used in some data providers, rules, result handlers and validators to convert or aggregate the manipulated data. They can also be used to transform properties.
Here is a list of all concrete transformers available in the [validationframework-core] (https://github.com/padrig64/ValidationFramework/tree/master/validationframework-core/src/main/java/com/google/code/validationframework/base) 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>. |
ChainedTransformer | <I> | <O> | Uses one or several transformers one after the other. |
CollectionElementTransformer | Collection<I> | Collection<O> | Transforms each element of the input collection using a specified element transformer. |
FormatTransformer | <I> | String | Uses a Format object to format the input object and return the formatted string. |
NegateBooleanTransformer | Boolean | Boolean | Negates the input boolean. |
NumberToByteTransformer | Number | Byte | Converts a Number into a Byte. |
NumberToDoubleTransformer | Number | Double | Converts a Number into a Double. |
NumberToFloatTransformer | Number | Float | Converts a Number into a Float. |
NumberToIntegerTransformer | Number | Integer | Converts a Number into an Integer. |
NumberToLongTransformer | Number | Long | Converts a Number into a Long. |
NumberToShortTransformer | Number | Short | Converts a Number into a Short. |
OrBooleanAggregator | Collection<Boolean> | Boolean | Performs the OR operation with all input booleans of the collection. |
ParseTransformer | String | <O> | Uses a Format object to parse the input string and return the parsed object. |
ToStringTransformer | <I> | String | Uses the toString() method of the input object of type <I>. |