Skip to main content
summaryrefslogtreecommitdiffstats
blob: 22739bcaeb672baba9cdc1ae2466ca135cfe6998 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*****************************************************************************
 * Copyright (c) 2013 CEA LIST.
 *
 *    
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Ansgar Radermacher  ansgar.radermacher@cea.fr  
 *
 *****************************************************************************/

package org.eclipse.papyrus.qompass.designer.core.deployment;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.qompass.designer.core.extensions.ILangSupport;
import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener;
import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier;
import org.eclipse.uml2.uml.Class;

/**
 * Gather configuration data for a code generation project
 * In particular, a class might be stereotyped to provide additional information
 * about required compilation options (in case of C++ include paths, libraries, ...)
 * 
 * @author ansgar
 */
public class GatherConfigData implements PreCopyListener {

	/**
	 * Gather configuration data for a code generation project
	 * Constructor.
	 * 
	 * @param langSupport
	 *        A reference to a class providing the language support interface
	 */
	public GatherConfigData(ILangSupport langSupport) {
		this.langSupport = langSupport;
	}

	public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) {
		if(sourceEObj instanceof Class) {
			langSupport.gatherConfigData((Class)sourceEObj);
		}
		return sourceEObj;
	}

	private ILangSupport langSupport;
}

Back to the top