Java Code Examples for spoon.reflect.declaration.CtElement#getPath()

The following examples show how to use spoon.reflect.declaration.CtElement#getPath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AstPathTest.java    From coming with MIT License 5 votes vote down vote up
private void retrievePathOFAffectedElements(List<Operation> rootops) {
	for (Operation<?> op : rootops) {

		CtElement left = op.getSrcNode();

		CtPath pleft = left.getPath();
		assertNotNull(pleft);

		CtElement right = op.getSrcNode();
		CtPath pright = right.getPath();
		assertNotNull(pright);

	}
}
 
Example 2
Source File: TreeTest.java    From gumtree-spoon-ast-diff with Apache License 2.0 5 votes vote down vote up
private void getPaths(List<Operation> rootops) {
	for (Operation<?> op : rootops) {

		CtElement left = op.getSrcNode();
		CtPath pleft = left.getPath();
		assertNotNull(pleft);

		CtElement right = op.getSrcNode();
		CtPath pright = right.getPath();
		assertNotNull(pleft);

	}
}
 
Example 3
Source File: TreeTest.java    From gumtree-spoon-ast-diff with Apache License 2.0 5 votes vote down vote up
@Override
public void scan(CtElement element) {
	if (element != null) {
		CtPath path = element.getPath();
		assertNotNull(path);

	}
	// to avoid visiting all childs
	super.scan(element);
}