Validator
Class to validate properties of a Vo
Static Method Summary
Static Public Methods | ||
public static |
checkProperty(property: String, value: any): true Check a property value |
|
public static |
getRulesFor(property: String): Array Get the list of validation rules |
|
public static |
hasRulesFor(property: String): Boolean Is there any validation rule for a given property |
|
public static |
isPropertyRequired(property: String): Boolean Is a property required? |
|
public static |
isPropertyUnique(property: String): Boolean Is a property unique? |
|
public static |
needToCheckProperty(property: String, value: any): Array Does a property need to be checked? |
|
public static |
Run a validator rules and get the result |
Constructor Summary
Public Constructor | ||
public |
constructor(vo: Vo) |
Method Summary
Public Methods | ||
public |
To know if the validation failed |
|
public |
Validate all the properties of the current Vo |
Static Public Methods
public static checkProperty(property: String, value: any): true source
Check a property value
Params:
Name | Type | Attribute | Description |
property | String | the property name |
|
value | any | the property value |
Return:
true |
public static getRulesFor(property: String): Array source
Get the list of validation rules
Params:
Name | Type | Attribute | Description |
property | String | the property name |
public static hasRulesFor(property: String): Boolean source
Is there any validation rule for a given property
Params:
Name | Type | Attribute | Description |
property | String | the property name |
public static isPropertyRequired(property: String): Boolean source
Is a property required?
Params:
Name | Type | Attribute | Description |
property | String | the property name |
public static isPropertyUnique(property: String): Boolean source
Is a property unique?
Params:
Name | Type | Attribute | Description |
property | String | the property name |
public static needToCheckProperty(property: String, value: any): Array source
Does a property need to be checked?
Params:
Name | Type | Attribute | Description |
property | String | the property name |
|
value | any | the property value |