ANTAREX API

Clava API

LARA API

LARA Common Language API

Check

Check

Check

Utility methods to check preconditions.


Static Members

arrayContains

arrayContains(array, element, message, source)

Checks if the array contains the element. Throws an expression if it doens't.
The test is equivalent to array.indexOf(element) != -1.

Parameters

array: unknown
element: unknown
message: unknown
source: unknown

diff

diff(original, revised)

Parameters

original: Object - The original text
revised: Object - The revised text

instance

instance(value, type, source, userTypeName)

Parameters

value: unknown
type: unknown
source: unknown
userTypeName: unknown

isArray

isArray(variable, source)

Parameters

variable: unknown
source: unknown

isBoolean

isBoolean(variable, source)

Parameters

variable: unknown
source: unknown

isDefined

isDefined(value, varName, source)

Parameters

value: any
varName: any
source: any

isJoinPoint

isJoinPoint($jp, [type = undefined], [isOptional = false])

Checks if the given value is a join point. If a type is given, checks if the join point is an instance of the given type. Otherwise, throws an exception.

Parameters

$jp: $jp
type: string (optional)
isOptional: boolean - If true, passes check if value is undefined (optional)

isNumber

isNumber(variable, source)

Parameters

variable: unknown
source: unknown

isRegex

isRegex(variable, source)

Parameters

variable: unknown
source: unknown

isString

isString(variable, source)

Parameters

variable: unknown
source: unknown

isTrue

isTrue(booleanExpr, message, source)

Throws an exception if the given expression evaluates to false.

Parameters

booleanExpr: unknown
message: unknown
source: unknown

isUndefined

isUndefined(value)

Parameters

value: unknown

Returns

boolean - true if the given value is either undefined or null.

strings

strings(currentString, expectedString)

Checks if two strings are identical, not considering empty spaces. Throws and exception if strings do not match.

Parameters

currentString: unknown
expectedString: unknown

type

type(value, type, source)

Parameters

value: unknown
type: unknown
source: unknown