Interface TransformationsSpi<N,​E,​T,​B,​TB extends B,​S,​I,​QI,​R extends RelatedExpression<N,​T,​B,​TB,​S,​QI,​R>,​A extends ASTBasedAnaphora<N,​E,​T,​B,​TB,​S,​I,​QI,​R,​A>>

Type Parameters:
N - The node type in the AST
E - The expression type
T - The type type
B - The binding type
TB - The type binding type
S - The scope type (optional)
I - The type used to represent identifiers
QI - The type used to represent qualified identifiers
R - The sub-type of related expression to use
A - The sub-type of AST-based anaphora to use

public interface TransformationsSpi<N,​E,​T,​B,​TB extends B,​S,​I,​QI,​R extends RelatedExpression<N,​T,​B,​TB,​S,​QI,​R>,​A extends ASTBasedAnaphora<N,​E,​T,​B,​TB,​S,​I,​QI,​R,​A>>
An interface to create AST transformations.
  • Method Summary

    Modifier and Type Method Description
    boolean partOfSameInvocable​(N node, E expression)  
    ASTTransformation<N,​E,​T,​B,​TB,​S,​I,​QI,​R,​A> passAlongCallChain​(N upstreamNode, E downstreamExpression, S scope)
    Attempts to create a transformation that pass the given upstream node or a representation of it along the call chain from the invocable (i.e.
  • Method Details

    • partOfSameInvocable

      boolean partOfSameInvocable​(N node, E expression)
      Returns:
      true if both nodes are contained in or are the same invocable (i.e. initializer, constructor, method or lambda expression).
    • passAlongCallChain

      ASTTransformation<N,​E,​T,​B,​TB,​S,​I,​QI,​R,​A> passAlongCallChain​(N upstreamNode, E downstreamExpression, S scope)
      Attempts to create a transformation that pass the given upstream node or a representation of it along the call chain from the invocable (i.e. initializer, constructor, method or lambda expression) containing the upstream node to the invocable containing the downstream node.

      Such a transformation can only be constructed if there is a call chain connecting upstream and downstream nodes and if the chain is no longer than the implementation-specific analysis limits of the SPI implementation.

      Returns:
      a transformation if it can be constructed, or null otherwise.