Interface CtPath

  • All Known Implementing Classes:
    CtPathImpl

    public interface CtPath
    A CtPath allows to define the path to a CtElement in the Spoon model, eg ".spoon.test.path.Foo.foo#body#statement[index=0]"
    • Method Detail

      • evaluateOn

        <T extends CtElementList<T> evaluateOn​(CtElement... startNode)
        Search for elements matching this CtPatch from start nodes given as parameters.
      • relativePath

        CtPath relativePath​(CtElement parent)
        Returns the path that is relative to the given element (subpath from it to the end of the path). This is used to have relative paths, instead of absolute path from the root package. For example, "#typeMember[index=2]#body#statement[index=2]#else" is a relative path to the class of absolute path "#subPackage[name=spoon]#subPackage[name=test]#subPackage[name=path]#subPackage[name=testclasses]#containedType[name=Foo]#typeMember[index=2]#body#statement[index=2]#else"