blob: 92fcb9523640790dd84b1d852e57459d73e3a2ab (
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
52
53
54
|
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.xtext.oxtype.resource;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.common.types.JvmType;
/**
* An adapter to attach the semantic element and a selector to the
* {@link JvmType}. The selector is used, if more then one {@link JvmType} is
* inferred for a single {@link EObject}. Then the inferer needs to separate
* which JvmTypes needs to be inferrerd at this state.
*/
public class DerivedRootAdapter extends AdapterImpl {
private final EObject semantic;
private final String selector;
public DerivedRootAdapter(EObject context, String selector) {
this.semantic = context;
this.selector = selector;
}
@Override
public boolean isAdapterForType(Object type) {
return type == DerivedRootAdapter.class;
}
/**
* @return the semantic
*/
public EObject getSemantic() {
return semantic;
}
/**
* @return the selector
*/
public String getSelector() {
return selector;
}
}
|