-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature CtScannerListener listens for nodes of EarlyTerminatingScanner
- Loading branch information
1 parent
6433c2c
commit 738aa24
Showing
2 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/spoon/reflect/visitor/chain/CtScannerListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright (C) 2006-2017 INRIA and contributors | ||
* Spoon - http://spoon.gforge.inria.fr/ | ||
* | ||
* This software is governed by the CeCILL-C License under French law and | ||
* abiding by the rules of distribution of free software. You can use, modify | ||
* and/or redistribute the software under the terms of the CeCILL-C license as | ||
* circulated by CEA, CNRS and INRIA at http://www.cecill.info. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details. | ||
* | ||
* The fact that you are presently reading this means that you have had | ||
* knowledge of the CeCILL-C license and that you accept its terms. | ||
*/ | ||
package spoon.reflect.visitor.chain; | ||
|
||
/** | ||
* Listens for entering/exiting of scanning of AST | ||
*/ | ||
public interface CtScannerListener { | ||
/** | ||
* Called before scanning process enters an element | ||
* <br> | ||
* The returning false or throwing an exception causes that processing of that element and all it's children is skipped. | ||
* The returning true causes that element is normally processed, and {@link #exit(Object)} will be called for that element. | ||
* | ||
* @param element the processed element | ||
* @return true to continue processing this element and it's children, | ||
* false to skip this element and it's children. | ||
*/ | ||
boolean enter(Object element); | ||
|
||
/** | ||
* This method is called after element and all it's children are processed. | ||
* This method is NOT called if the exception was thrown in {@link #enter(Object)} or during processing of element or any children children | ||
* This method is NOT called for element whose {@link #enter(Object)} returned false | ||
* | ||
* @param element the processed element | ||
*/ | ||
void exit(Object element); | ||
} |