Interface: Validator

Oracle® JavaScript Extension Toolkit (JET)
9.0.0

F24343-01

Signature:

interface Validator<V>

QuickNav

Validator

Version:
  • 9.0.0
Since:
  • 0.6.0
Module:
  • ojvalidator

Module usage

See JET Module Loading for an overview of module usage within JET.

Typescript Import Format
//To use this interface, import as below.
import Validator= require("ojs/ojvalidator");

//To access this interface in your code:
declare class MyValidator implements Validator
Generic Parameters
ParameterDescription
VType of value to be validated

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Methods

getHint(): string|null

Returns a hint that describes the validator rule.
Returns:
a hint string or null
Type
string | null

validate(value) : {void}

Validates the value. The function typically returns if the validation passes and throws an error if it fails.
Parameters:
Name Type Description
value V to be validated
Throws:
if validation fails
Type
Error
Returns:
Type
void