]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | package no.uio.ifi.refaktor.change.changers; |
2 | ||
3 | import no.uio.ifi.refaktor.analyze.ExtractAndMoveMethodCandidate; | |
4 | import no.uio.ifi.refaktor.analyze.analyzers.AggregationAnalyzer; | |
5 | import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException; | |
6 | import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor; | |
7 | ||
8 | import org.eclipse.core.runtime.CoreException; | |
9 | import org.eclipse.core.runtime.IProgressMonitor; | |
10 | ||
11 | /** | |
12 | * A {@link RefaktorChanger} that is responsible for running an | |
13 | * {@link AggregationAnalyzer} and executing the | |
14 | * {@link ExtractAndMoveMethodExecutor} on all results returned from it. | |
15 | */ | |
16 | public class AggregationAnalyzerChanger implements RefaktorChanger { | |
17 | ||
18 | private AggregationAnalyzer<ExtractAndMoveMethodCandidate> analyzer; | |
19 | ||
20 | public AggregationAnalyzerChanger(AggregationAnalyzer<ExtractAndMoveMethodCandidate> analyzer) { | |
21 | this.analyzer = analyzer; | |
22 | } | |
23 | ||
24 | @Override | |
25 | public void checkPreconditions() throws RefaktorAnalyzerException { | |
26 | analyzer.analyze(); | |
27 | } | |
28 | ||
29 | @Override | |
30 | public void execute(IProgressMonitor monitor) throws CoreException { | |
31 | for (ExtractAndMoveMethodCandidate result: analyzer.getResults()) { | |
32 | result.generated_2051493397028639653(this); | |
33 | } | |
34 | } | |
35 | } |