Package spoon.reflect.path.impl
Class CtPathImpl
- java.lang.Object
-
- spoon.reflect.path.impl.CtPathImpl
-
-
Constructor Summary
Constructors Constructor Description CtPathImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CtPathImpl
addFirst(CtPathElement element)
CtPathImpl
addLast(CtPathElement element)
<T extends CtElement>
List<T>evaluateOn(CtElement... startNode)
Search for elements matching this CtPatch from start nodes given as parameters.List<CtPathElement>
getElements()
CtPath
relativePath(CtElement parent)
Returns the path that is relative to the given element (subpath from it to the end of the path).String
toString()
-
-
-
Method Detail
-
getElements
public List<CtPathElement> getElements()
-
evaluateOn
public <T extends CtElement> List<T> evaluateOn(CtElement... startNode)
Description copied from interface:CtPath
Search for elements matching this CtPatch from start nodes given as parameters.- Specified by:
evaluateOn
in interfaceCtPath
-
relativePath
public CtPath relativePath(CtElement parent)
Description copied from interface:CtPath
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"- Specified by:
relativePath
in interfaceCtPath
-
addFirst
public CtPathImpl addFirst(CtPathElement element)
-
addLast
public CtPathImpl addLast(CtPathElement element)
-
-