Class for selection of join points. Provides an API similar to the keyword 'select'.

Search functions of this class return weaver.Selector objects, please refer to that class for more details regarding available functions and search options.

Constructors

Methods

  • The same as Query.searchFrom(), but uses the root node as $baseJp.

    Type Parameters

    Parameters

    • type: T

      type of the join point to search.

    • Optionalfilter: Filter_WrapperVariant<T>

      filter rules for the search. If the value is an object, each field of the object represents a rule that will be applied over the attribute that has the same name as the name of the field. If the value is not an object (e.g., String, Regex, Lambda), it is interpreted as a single rule that will be applied over the default attribute of the given type. E.g., if type is 'function', the value is a String 'foo' and the default attribute of function is 'name', this is equivalent as passing as value the object {'name':'foo'}. Rules can be a String (i.e., will match the value of the attribute against a string), a Regex (will match the value of the attribute against a regex) or a Function (i.e., function receives the value of the attribute and returns true if there is a match, or false otherwise).

    • Optionaltraversal: TraversalType

      AST traversal type, according to weaver.TraversalType

    Returns selector<T, T>

    The results of the search.

  • The same as Query.searchFrom(), but uses the root node as $baseJp.

    Parameters

    • type: string

      type of the join point to search.

    • Optionalfilter: Filter_StringVariant

      filter rules for the search. If the value is an object, each field of the object represents a rule that will be applied over the attribute that has the same name as the name of the field. If the value is not an object (e.g., String, Regex, Lambda), it is interpreted as a single rule that will be applied over the default attribute of the given type. E.g., if type is 'function', the value is a String 'foo' and the default attribute of function is 'name', this is equivalent as passing as value the object {'name':'foo'}. Rules can be a String (i.e., will match the value of the attribute against a string), a Regex (will match the value of the attribute against a regex) or a Function (i.e., function receives the value of the attribute and returns true if there is a match, or false otherwise).

    • Optionaltraversal: TraversalType

      AST traversal type, according to weaver.TraversalType

    Returns selector<typeof LaraJoinPoint, typeof LaraJoinPoint>

    The results of the search.

    Use the new version of this function that receives a class as the first parameter.

  • In-depth search of nodes of the given type, starting from a base node (exclusive).

    Type Parameters

    Parameters

    • $baseJp: LaraJoinPoint

      starting join point for the search.

    • Optionaltype: T

      type of the join point to search.

    • Optionalfilter: Filter_WrapperVariant<T>

      filter rules for the search. If the value is an object, each field of the object represents a rule that will be applied over the attribute that has the same name as the name of the field. If the value is not an object (e.g., String, Regex, Lambda), it is interpreted as a single rule that will be applied over the default attribute of the given type. E.g., if type is 'function', the value is a String 'foo' and the default attribute of function is 'name', this is equivalent as passing as value the object {'name':'foo'}. Rules can be a String (i.e., will match the value of the attribute against a string), a Regex (will match the value of the attribute against a regex) or a Function (i.e., function receives the value of the attribute and returns true if there is a match, or false otherwise).

    • Optionaltraversal: TraversalType

      AST traversal type, according to weaver.TraversalType

    Returns selector<T, T>

    The results of the search.

  • In-depth search of nodes of the given type, starting from a base node (exclusive).

    Parameters

    • $baseJp: LaraJoinPoint

      starting join point for the search.

    • Optionaltype: string

      type of the join point to search.

    • Optionalfilter: Filter_StringVariant

      filter rules for the search. If the value is an object, each field of the object represents a rule that will be applied over the attribute that has the same name as the name of the field. If the value is not an object (e.g., String, Regex, Lambda), it is interpreted as a single rule that will be applied over the default attribute of the given type. E.g., if type is 'function', the value is a String 'foo' and the default attribute of function is 'name', this is equivalent as passing as value the object {'name':'foo'}. Rules can be a String (i.e., will match the value of the attribute against a string), a Regex (will match the value of the attribute against a regex) or a Function (i.e., function receives the value of the attribute and returns true if there is a match, or false otherwise).

    • Optionaltraversal: TraversalType

      AST traversal type, according to weaver.TraversalType

    Returns selector<typeof LaraJoinPoint, typeof LaraJoinPoint>

    The results of the search.

    Use the new version of this function that receives a class as the first parameter.