Class CtPathBuilder

java.lang.Object
spoon.reflect.path.CtPathBuilder

public class CtPathBuilder extends Object
This builder allow to create some CtPath.

Some examples:

To create a CtPath that match with any method in fr.spoon.Launcher:

 
 new CtPathBuilder().name("fr").name("spoon").name("Launcher").type("method");
 
 
Created by nicolas on 10/06/2015.
  • Constructor Details

    • CtPathBuilder

      public CtPathBuilder()
  • Method Details

    • name

      public CtPathBuilder name(String name, String[]... args)
      Add a name matcher to this path.
      Parameters:
      name -
      args -
      Returns:
    • wildcard

      public CtPathBuilder wildcard()
      Add a simple wildcard. Match only on elements child of current one.
    • recursiveWildcard

      public CtPathBuilder recursiveWildcard()
      Add a recursive wildcard. It match on any child and sub-childs.
    • type

      public <T extends CtElement> CtPathBuilder type(Class<T> type, String[]... args)
      Match on element of a given type.
    • role

      public CtPathBuilder role(CtRole role, String[]... args)
      Match on elements by their role.
      See Also:
      CtRole
    • build

      public CtPath build()
      Build the CtPath