]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/refaktor-before/src/no/uio/ifi/refaktor/analyze/collectors/PropertyCollector.java
Some talks, mostly identical.
[ifi-stolz-refaktor.git] / case-study / refaktor-before / src / no / uio / ifi / refaktor / analyze / collectors / PropertyCollector.java
CommitLineData
1b2798f6
EK
1package no.uio.ifi.refaktor.analyze.collectors;
2
3import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection;
4
5import org.eclipse.jdt.core.dom.ASTNode;
6import org.eclipse.jdt.core.dom.ASTVisitor;
7
8/**
9 * A PropertyCollector is responsible for collecting
10 * properties from an AST, and in particular, properties
11 * from within a selection.
12 *
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:
17 *
18 * if (!nodeInSelection(node))
19 * return false;
20 */
21public abstract class PropertyCollector extends ASTVisitor {
22
23 protected final CompilationUnitTextSelection selection;
24
25 public PropertyCollector(CompilationUnitTextSelection selection) {
26 super();
27 this.selection = selection;
28 }
29
30 protected boolean nodeInSelection(ASTNode node) {
31 return selection.surroundsNode(node);
32 }
33
34 public abstract void clearData();
35}