Options
Menu

Class JQueryValidationRuleFactory

It represents the JSON schema factory for creating validation rules based on raw JSON data annotated by validation rules. It uses constraints keywords from JQuery validation plugin.

Index

Constructor methods

constructor

  • Default constructor

    Parameters

    • metaData: any
      • raw JSON data annotated by validation rules

    Returns JQueryValidationRuleFactory

Properties

static DEFAULT_KEY

DEFAULT_KEY: string

static RULES_KEY

RULES_KEY: string

private metaData

metaData: any

Methods

CreateRule

  • CreateRule(name: string): Validation.IAbstractValidationRule<any>
  • Return an concrete validation rule by traversing raw JSON data annotated by validation rules.

    Parameters

    • name: string

      validation rule name

    Returns Validation.IAbstractValidationRule<any>

    return validation rule

private ParseAbstractRule

  • ParseAbstractRule(metaData: any): Validation.IAbstractValidator<any>
  • Returns an concrete validation rule structured according to JSON schema.

    Parameters

    • metaData: any

    Returns Validation.IAbstractValidator<any>

private ParseValidationAttribute

  • ParseValidationAttribute(item: any): Array<Validation.IPropertyValidator>
  • Return list of property validators that corresponds json items for JQuery validation pluging tags. See specification - http://jqueryvalidation.org/documentation/

    Parameters

    • item: any

    Returns Array<Validation.IPropertyValidator>

Generated using TypeDoc