Package spoon.reflect.path.impl
Class CtPathImpl
java.lang.Object
spoon.reflect.path.impl.CtPathImpl
- All Implemented Interfaces:
CtPath
Default implementation for a CtPath
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFirst
(CtPathElement element) addLast
(CtPathElement element) evaluateOn
(CtElement... startNode) Search for elements matching this CtPatch from start nodes given as parameters.relativePath
(CtElement parent) Returns the path that is relative to the given element (subpath from it to the end of the path).toString()
-
Constructor Details
-
CtPathImpl
public CtPathImpl()
-
-
Method Details
-
getElements
-
evaluateOn
Description copied from interface:CtPath
Search for elements matching this CtPatch from start nodes given as parameters.- Specified by:
evaluateOn
in interfaceCtPath
-
relativePath
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
-
addLast
-
toString
-