Remove all existing @since annotations
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / analysis / TmfNewAnalysisOutputListener.java
1 /*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.tmf.core.analysis;
14
15 import org.eclipse.jdt.annotation.NonNull;
16
17 /**
18 * This class listens when new analysis modules are created and registers an
19 * output if the module corresponds to the output specifications
20 *
21 * @author Geneviève Bastien
22 */
23 public class TmfNewAnalysisOutputListener implements ITmfNewAnalysisModuleListener {
24
25 private final String fAnalysisId;
26 private final Class<? extends IAnalysisModule> fAnalysisModuleClass;
27 private final @NonNull IAnalysisOutput fOutput;
28
29 /**
30 * Constructor
31 *
32 * @param output
33 * The analysis output to add if the analysis corresponds to the
34 * ID or class
35 * @param analysisId
36 * The analysis ID of the single analysis to match
37 * @param moduleClass
38 * The module class this output applies to
39 */
40 public TmfNewAnalysisOutputListener(@NonNull IAnalysisOutput output, String analysisId, Class<? extends IAnalysisModule> moduleClass) {
41 fOutput = output;
42 fAnalysisId = analysisId;
43 fAnalysisModuleClass = moduleClass;
44 }
45
46 @Override
47 public void moduleCreated(IAnalysisModule module) {
48 if (fAnalysisId != null) {
49 if (module.getId().equals(fAnalysisId)) {
50 module.registerOutput(fOutput);
51 }
52 } else if (fAnalysisModuleClass != null) {
53 if (fAnalysisModuleClass.isAssignableFrom(module.getClass())) {
54 module.registerOutput(fOutput);
55 }
56 }
57 }
58
59 }
This page took 0.036229 seconds and 5 git commands to generate.