1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.util; |
7 | |
8 | import de.uka.ipd.sdq.pcm.*; |
9 | import org.eclipse.emf.common.notify.Adapter; |
10 | import org.eclipse.emf.common.notify.Notifier; |
11 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; |
12 | import org.eclipse.emf.ecore.EObject; |
13 | |
14 | import de.uka.ipd.sdq.pcm.DummyClass; |
15 | import de.uka.ipd.sdq.pcm.PcmPackage; |
16 | |
17 | /** |
18 | * <!-- begin-user-doc --> |
19 | * The <b>Adapter Factory</b> for the model. |
20 | * It provides an adapter <code>createXXX</code> method for each class of the model. |
21 | * <!-- end-user-doc --> |
22 | * @see de.uka.ipd.sdq.pcm.PcmPackage |
23 | * @generated |
24 | */ |
25 | public class PcmAdapterFactory extends AdapterFactoryImpl { |
26 | /** |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
32 | |
33 | /** |
34 | * The cached model package. |
35 | * <!-- begin-user-doc --> |
36 | * <!-- end-user-doc --> |
37 | * @generated |
38 | */ |
39 | protected static PcmPackage modelPackage; |
40 | |
41 | /** |
42 | * Creates an instance of the adapter factory. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @generated |
46 | */ |
47 | public PcmAdapterFactory() { |
48 | if (modelPackage == null) { |
49 | modelPackage = PcmPackage.eINSTANCE; |
50 | } |
51 | } |
52 | |
53 | /** |
54 | * Returns whether this factory is applicable for the type of the object. |
55 | * <!-- begin-user-doc --> |
56 | * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. |
57 | * <!-- end-user-doc --> |
58 | * @return whether this factory is applicable for the type of the object. |
59 | * @generated |
60 | */ |
61 | @Override |
62 | public boolean isFactoryForType(Object object) { |
63 | if (object == modelPackage) { |
64 | return true; |
65 | } |
66 | if (object instanceof EObject) { |
67 | return ((EObject)object).eClass().getEPackage() == modelPackage; |
68 | } |
69 | return false; |
70 | } |
71 | |
72 | /** |
73 | * The switch that delegates to the <code>createXXX</code> methods. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | protected PcmSwitch<Adapter> modelSwitch = |
79 | new PcmSwitch<Adapter>() { |
80 | @Override |
81 | public Adapter caseDummyClass(DummyClass object) { |
82 | return createDummyClassAdapter(); |
83 | } |
84 | @Override |
85 | public Adapter defaultCase(EObject object) { |
86 | return createEObjectAdapter(); |
87 | } |
88 | }; |
89 | |
90 | /** |
91 | * Creates an adapter for the <code>target</code>. |
92 | * <!-- begin-user-doc --> |
93 | * <!-- end-user-doc --> |
94 | * @param target the object to adapt. |
95 | * @return the adapter for the <code>target</code>. |
96 | * @generated |
97 | */ |
98 | @Override |
99 | public Adapter createAdapter(Notifier target) { |
100 | return modelSwitch.doSwitch((EObject)target); |
101 | } |
102 | |
103 | |
104 | /** |
105 | * Creates a new adapter for an object of class '{@link de.uka.ipd.sdq.pcm.DummyClass <em>Dummy Class</em>}'. |
106 | * <!-- begin-user-doc --> |
107 | * This default implementation returns null so that we can easily ignore cases; |
108 | * it's useful to ignore a case when inheritance will catch all the cases anyway. |
109 | * <!-- end-user-doc --> |
110 | * @return the new adapter. |
111 | * @see de.uka.ipd.sdq.pcm.DummyClass |
112 | * @generated |
113 | */ |
114 | public Adapter createDummyClassAdapter() { |
115 | return null; |
116 | } |
117 | |
118 | /** |
119 | * Creates a new adapter for the default case. |
120 | * <!-- begin-user-doc --> |
121 | * This default implementation returns null. |
122 | * <!-- end-user-doc --> |
123 | * @return the new adapter. |
124 | * @generated |
125 | */ |
126 | public Adapter createEObjectAdapter() { |
127 | return null; |
128 | } |
129 | |
130 | } //PcmAdapterFactory |