Skip to main content
summaryrefslogtreecommitdiffstats
blob: a9341bdaa9b275bbae87445f8a1bd9d8ec732f78 (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
/**
 * Copyright (c) 2012, 2013 Mia-Software.
 * 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:
 *    Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
 *    Gregoire Dupé (Mia-Software) - Bug 418885 - ETypedElementSwitchQuery implemented using a deprecated query evaluator extension point
 */
package org.eclipse.emf.facet.custom.core.internal.query;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.CustomPackage;
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementSwitchQuery;
import org.eclipse.emf.facet.efacet.core.IDerivedTypedElementManager;
import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
import org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementImplementation;
import org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementImplementationFactory;
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
import org.osgi.framework.Bundle;

/**
 * @deprecated replaced by {@link SwitchQueryImplementationFactory}
 */
@Deprecated
public class ETypedElementSwitchQueryImplementationFactory implements IDerivedTypedElementImplementationFactory {

	public IDerivedTypedElementImplementation create(final Query query, final Bundle bundle, final IDerivedTypedElementManager derivedTEManager)
			throws DerivedTypedElementException {
		if (!(query instanceof ETypedElementSwitchQuery)) {
			throw new IllegalArgumentException("The given DerivedTypedElement does not have a IsOneOfQuery"); //$NON-NLS-1$
		}
		final ETypedElementSwitchQueryImplementation evaluator = new ETypedElementSwitchQueryImplementation(
				(ETypedElementSwitchQuery) query, derivedTEManager);
		evaluator.setCheckResultType(false);
		return evaluator;
	}

	public EClass getManagedQueryType() {
		return CustomPackage.eINSTANCE.getETypedElementSwitchQuery();
	}

}

Back to the top