UnrecognizedValidator

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new UnrecognizedValidator(isValid?: boolean): UnrecognizedValidator

Creates an instance of UnrecognizedValidator. Creates an instance of UnrecognizedValidator.

Parameters:

NameTypeDescription
isValid?booleanDefault behavior for unrecognized arguments.

Returns: UnrecognizedValidator

Properties

Static describer

describer: Describer

Inherited from PatternValidator.describer

Overrides void

Methods

canValidate

canValidate(expectation: Expectation): boolean

Evaluates if validator can handle provided expectation.

Parameters:

NameTypeDescription
expectationExpectationEvaluated explicit Pattern instance or implicit expectation.

Returns: boolean

Returns true if pattern is instance of Unrecognized, else false.


describe

describe(value: any): string

Inherited from PatternValidator.describe

Overrides void

Parameters:

NameType
valueany

Returns: string


getDefaultBehavior

getDefaultBehavior(): boolean

Returns default behavior(result) that is returned upon validating unrecognized value.

Returns: boolean

Returns true if default behavior is set to that behavior, else false.


validate

validate(value: any, unrecognized: Unrecognized): boolean

Validates if value matches pattern expectation(undefined).

throws {UnknownError} Thrown as default behavior of unrecognized arguments.

Parameters:

NameTypeDescription
valueanyValue that is validated against expectation.
unrecognizedUnrecognizedExplicit pattern as Unrecognized instance.

Returns: boolean

Returns the default behavior for validation of unrecognized arguments.


Static getDescriber

getDescriber(): Describer

Inherited from PatternValidator.getDescriber

Overrides void

Returns: Describer


Static setDescriber

setDescriber(describer: Describer): void

Inherited from PatternValidator.setDescriber

Overrides void

Parameters:

NameType
describerDescriber

Returns: void