after
static
void
after
(
instance
,
name
,
handler
,
[args]
)
Intercepts a method and invokes a handler after its execution.
Arguments remains untouched for the original method, while the {@param}
Arguments remains untouched for the original method, while the {@param}
handler
takes {@param} args
.
- Parameters:
-
instance <Object>
the variable containing the reference to the instance of an Object -
name <String>
the name of the method to be wrapped -
handler <Function>
the function fired after method named asname
-
[args] <Object>
optional arguments for thehandler
- Returns:
void
afterThrowing
static
void
afterThrowing
(
instance
,
name
,
handler
,
[args]
)
Intercepts an error thrown by a method and invokes a handler after its execution.
Arguments remains untouched for the original method, while the {@param}
Arguments remains untouched for the original method, while the {@param}
handler
takes {@param} args
.
- Parameters:
-
instance <Object>
the variable containing the reference to the instance of an Object -
name <String>
the name of the method to be wrapped -
handler <Function>
the function fired after method named asname
has thrown an error -
[args] <Object>
optional arguments for thehandler
- Returns:
void
before
static
void
before
(
instance
,
name
,
handler
,
[args]
)
Intercepts a method and invokes a handler before its execution.
Arguments remains untouched for the original method, while the {@param}
Arguments remains untouched for the original method, while the {@param}
handler
takes {@param} args
.
- Parameters:
-
instance <Object>
the variable containing the reference to the instance of an Object -
name <String>
the name of the method to be wrapped -
handler <Function>
the function fired before method named asname
-
[args] <Object>
optional arguments for thehandler
- Returns:
void
isDefined
static
boolean
isDefined
(
arguments
)
Returns false at first
For a deeper check against
undefined
Object passed as argument.For a deeper check against
undefined
and null
use isDefOrNull
- Parameters:
-
arguments <Object>
Uses the nativearguments
list.
- Returns:
boolean
- false if at least one argument is
undefined
checked with nativetypeof
operator. If no argument is passed it returns true.
isDefinedOrNull
static
boolean
isDefinedOrNull
(
arguments
)
Returns false at first
If no arguments is passed it returns false
undefined
or null
Object passed as argument.If no arguments is passed it returns false
- Parameters:
-
arguments <Object>
Uses the nativearguments
list.
- Returns:
boolean
- false if at least one argument is
undefined
(checked with nativetypeof
operator) ornull
. If no argument is passed it returns false.
override
static
void
override
(
instance
,
name
,
handler
,
[args]
)
Intercepts a method and invokes a handler instead of its execution.
The {@param}
The {@param}
handler
takes {@param} args
as arguments.
- Parameters:
-
instance <Object>
the variable containing the reference to the instance of an Object -
name <String>
the name of the method to be overridden -
handler <Function>
the function fired instead method named asname
-
[args] <Object>
optional arguments for thehandler
- Returns:
void