Package io.codemodder

Interface NodeCollector


public interface NodeCollector
A type that can collect specific types of nodes from a CompilationUnit.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final NodeCollector
    A NodeCollector implementation that collects all comments from a CompilationUnit.
    static final NodeCollector
    A NodeCollector implementation that collects all nodes of a specified type.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<? extends com.github.javaparser.ast.Node>
    collectNodes(com.github.javaparser.ast.CompilationUnit cu, Class<? extends com.github.javaparser.ast.Node> nodeType)
    Collects nodes of the specified type from the CompilationUnit.
  • Field Details

    • ALL_FROM_TYPE

      static final NodeCollector ALL_FROM_TYPE
      A NodeCollector implementation that collects all nodes of a specified type.
    • ALL_COMMENTS

      static final NodeCollector ALL_COMMENTS
      A NodeCollector implementation that collects all comments from a CompilationUnit.
  • Method Details

    • collectNodes

      List<? extends com.github.javaparser.ast.Node> collectNodes(com.github.javaparser.ast.CompilationUnit cu, Class<? extends com.github.javaparser.ast.Node> nodeType)
      Collects nodes of the specified type from the CompilationUnit.