1 package no.uio.ifi.refaktor.analyze.collectors;
3 import no.uio.ifi.refaktor.utils.CompilationUnitTextSelection;
5 import org.eclipse.jdt.core.dom.ASTNode;
6 import org.eclipse.jdt.core.dom.ASTVisitor;
9 * A PropertyCollector is responsible for collecting
10 * properties from an AST, and in particular, properties
11 * from within a selection.
13 * If the visitor shall be limited to visiting nodes inside
14 * the selection, then subclasses that overrides a
15 * visit(ASTNode node) method must put this formulary
16 * as the first thing inside the method:
18 * if (!nodeInSelection(node))
21 public abstract class PropertyCollector extends ASTVisitor {
23 private final CompilationUnitTextSelection selection;
25 public PropertyCollector(CompilationUnitTextSelection selection) {
27 this.selection = selection;
30 protected CompilationUnitTextSelection getSelection() {
34 protected boolean nodeInSelection(ASTNode node) {
35 return selection.surroundsNode(node);
38 public abstract void clearData();