KADABRA API

LARA API

LARA Common Language API

(.js)
laraImport("weaver.JoinPoints");

(.lara)
import weaver.JoinPoints;

JoinPoints

Constructor

JoinPoints

new JoinPoints()

Object which provides low-level join point-related methods.


Static Members

getAttribute

getAttribute($jp, attributeNames)

Iterates of attributeNames, returns the first value that is not null or undefined.
If no value is found for the given attributes, returns undefined

Parameters

$jp: any
attributeNames: any

getAttributeStrict

getAttributeStrict($jp, attributeNames)

Helper method of getAttribute which throws an exception if no value is found

Parameters

$jp: any
attributeNames: any

getCode

getCode($jp)

Converts the join point to a string of code. Expects attribute 'code' to exist.

Parameters

$jp: joinpoint - join point to convert to code.

Returns

String - a String with the code representation of this join point.

getInstance

getInstance()

Instance Members

children

children($jp, jpType)

Parameters

$jp: any
jpType: any

Returns

$jp[] - the children of the given node, according to the AST

descendants

descendants($jp, jpType)

Parameters

$jp: any
jpType: any

Returns

$jp[] - the descendants of the given node, according to the AST, preorder traversal

descendantsPostorder

descendantsPostorder($jp, jpType)

Parameters

$jp: any
jpType: any

Returns

$jp[] - the descendants of the given node, according to the AST, postorder traversal

root

root()

Returns

$jp - the current root node of the AST

scope

scope($jp, jpType)

Parameters

$jp: any
jpType: any

Returns

$jp[] - the nodes inside the scope of the given node.

toJoinPoint

toJoinPoint([missing param name], node)

Converts an AST node to a JointPoint.

Parameters

[missing param name]: node
node: any

Returns

$jp