1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.util
;
13 import org
.eclipse
.emf
.common
.notify
.Adapter
;
14 import org
.eclipse
.emf
.common
.notify
.Notifier
;
15 import org
.eclipse
.emf
.common
.notify
.impl
.AdapterFactoryImpl
;
16 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.*;
17 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche
;
18 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.UML2CompareTestProfilePackage
;
19 import org
.eclipse
.emf
.ecore
.EObject
;
22 * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter
23 * <code>createXXX</code> method for each class of the model. <!-- end-user-doc -->
25 * @see org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage
28 public class UML2CompareTestProfileAdapterFactory
extends AdapterFactoryImpl
{
30 * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc -->
34 protected static UML2CompareTestProfilePackage modelPackage
;
37 * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc -->
41 public UML2CompareTestProfileAdapterFactory() {
42 if (modelPackage
== null) {
43 modelPackage
= UML2CompareTestProfilePackage
.eINSTANCE
;
48 * Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> This
49 * implementation returns <code>true</code> if the object is either the model's package or is an instance
50 * object of the model. <!-- end-user-doc -->
52 * @return whether this factory is applicable for the type of the object.
56 public boolean isFactoryForType(Object object
) {
57 if (object
== modelPackage
) {
60 if (object
instanceof EObject
) {
61 return ((EObject
)object
).eClass().getEPackage() == modelPackage
;
67 * The switch that delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> <!--
72 protected UML2CompareTestProfileSwitch
<Adapter
> modelSwitch
= new UML2CompareTestProfileSwitch
<Adapter
>() {
74 public Adapter
caseACliche(ACliche object
) {
75 return createAClicheAdapter();
79 public Adapter
caseACliche2(ACliche2 object
) {
80 return createACliche2Adapter();
84 public Adapter
caseACliche3(ACliche3 object
) {
85 return createACliche3Adapter();
89 public Adapter
defaultCase(EObject object
) {
90 return createEObjectAdapter();
95 * Creates an adapter for the <code>target</code>. <!-- begin-user-doc --> <!-- end-user-doc -->
98 * the object to adapt.
99 * @return the adapter for the <code>target</code>.
103 public Adapter
createAdapter(Notifier target
) {
104 return modelSwitch
.doSwitch((EObject
)target
);
108 * Creates a new adapter for an object of class '
109 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche <em>ACliche</em>}'.
110 * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases;
111 * it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
113 * @return the new adapter.
114 * @see org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche
117 public Adapter
createAClicheAdapter() {
122 * Creates a new adapter for an object of class '
123 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche2 <em>ACliche2</em>}'.
124 * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases;
125 * it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
127 * @return the new adapter.
128 * @see org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche2
131 public Adapter
createACliche2Adapter() {
136 * Creates a new adapter for an object of class '
137 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche3 <em>ACliche3</em>}'.
138 * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases;
139 * it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
141 * @return the new adapter.
142 * @see org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche3
145 public Adapter
createACliche3Adapter() {
150 * Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns
151 * null. <!-- end-user-doc -->
153 * @return the new adapter.
156 public Adapter
createEObjectAdapter() {
160 } // UML2CompareTestProfileAdapterFactory