001 /**
002 * <copyright>
003 * </copyright>
004 *
005 * $Id$
006 */
007 package com.hammurapi.reasoning.spi.model.util;
008
009 import com.hammurapi.config.Factory;
010 import com.hammurapi.config.Named;
011 import com.hammurapi.config.NamedObjectDefinition;
012 import com.hammurapi.config.ObjectDefinition;
013 import com.hammurapi.config.PropertySource;
014
015 import com.hammurapi.party.CommonObject;
016 import com.hammurapi.reasoning.spi.model.*;
017
018 import org.eclipse.emf.common.notify.Adapter;
019 import org.eclipse.emf.common.notify.Notifier;
020
021 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
022
023 import org.eclipse.emf.ecore.EObject;
024
025 /**
026 * <!-- begin-user-doc -->
027 * The <b>Adapter Factory</b> for the model.
028 * It provides an adapter <code>createXXX</code> method for each class of the model.
029 * <!-- end-user-doc -->
030 * @see com.hammurapi.reasoning.spi.model.ModelPackage
031 * @generated
032 */
033 public class ModelAdapterFactory extends AdapterFactoryImpl {
034 /**
035 * The cached model package.
036 * <!-- begin-user-doc -->
037 * <!-- end-user-doc -->
038 * @generated
039 */
040 protected static ModelPackage modelPackage;
041
042 /**
043 * Creates an instance of the adapter factory.
044 * <!-- begin-user-doc -->
045 * <!-- end-user-doc -->
046 * @generated
047 */
048 public ModelAdapterFactory() {
049 if (modelPackage == null) {
050 modelPackage = ModelPackage.eINSTANCE;
051 }
052 }
053
054 /**
055 * Returns whether this factory is applicable for the type of the object.
056 * <!-- begin-user-doc -->
057 * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
058 * <!-- end-user-doc -->
059 * @return whether this factory is applicable for the type of the object.
060 * @generated
061 */
062 @Override
063 public boolean isFactoryForType(Object object) {
064 if (object == modelPackage) {
065 return true;
066 }
067 if (object instanceof EObject) {
068 return ((EObject)object).eClass().getEPackage() == modelPackage;
069 }
070 return false;
071 }
072
073 /**
074 * The switch that delegates to the <code>createXXX</code> methods.
075 * <!-- begin-user-doc -->
076 * <!-- end-user-doc -->
077 * @generated
078 */
079 protected ModelSwitch<Adapter> modelSwitch =
080 new ModelSwitch<Adapter>() {
081 @Override
082 public Adapter caseRuleSet(RuleSet object) {
083 return createRuleSetAdapter();
084 }
085 @Override
086 public Adapter caseRule(Rule object) {
087 return createRuleAdapter();
088 }
089 @Override
090 public Adapter caseCommonObject(CommonObject object) {
091 return createCommonObjectAdapter();
092 }
093 @Override
094 public Adapter caseFactory(Factory object) {
095 return createFactoryAdapter();
096 }
097 @Override
098 public Adapter caseNamed(Named object) {
099 return createNamedAdapter();
100 }
101 @Override
102 public Adapter casePropertySource(PropertySource object) {
103 return createPropertySourceAdapter();
104 }
105 @Override
106 public Adapter caseObjectDefinition(ObjectDefinition object) {
107 return createObjectDefinitionAdapter();
108 }
109 @Override
110 public Adapter caseNamedObjectDefinition(NamedObjectDefinition object) {
111 return createNamedObjectDefinitionAdapter();
112 }
113 @Override
114 public Adapter defaultCase(EObject object) {
115 return createEObjectAdapter();
116 }
117 };
118
119 /**
120 * Creates an adapter for the <code>target</code>.
121 * <!-- begin-user-doc -->
122 * <!-- end-user-doc -->
123 * @param target the object to adapt.
124 * @return the adapter for the <code>target</code>.
125 * @generated
126 */
127 @Override
128 public Adapter createAdapter(Notifier target) {
129 return modelSwitch.doSwitch((EObject)target);
130 }
131
132
133 /**
134 * Creates a new adapter for an object of class '{@link com.hammurapi.reasoning.spi.model.RuleSet <em>Rule Set</em>}'.
135 * <!-- begin-user-doc -->
136 * This default implementation returns null so that we can easily ignore cases;
137 * it's useful to ignore a case when inheritance will catch all the cases anyway.
138 * <!-- end-user-doc -->
139 * @return the new adapter.
140 * @see com.hammurapi.reasoning.spi.model.RuleSet
141 * @generated
142 */
143 public Adapter createRuleSetAdapter() {
144 return null;
145 }
146
147 /**
148 * Creates a new adapter for an object of class '{@link com.hammurapi.reasoning.spi.model.Rule <em>Rule</em>}'.
149 * <!-- begin-user-doc -->
150 * This default implementation returns null so that we can easily ignore cases;
151 * it's useful to ignore a case when inheritance will catch all the cases anyway.
152 * <!-- end-user-doc -->
153 * @return the new adapter.
154 * @see com.hammurapi.reasoning.spi.model.Rule
155 * @generated
156 */
157 public Adapter createRuleAdapter() {
158 return null;
159 }
160
161 /**
162 * Creates a new adapter for an object of class '{@link com.hammurapi.party.CommonObject <em>Common Object</em>}'.
163 * <!-- begin-user-doc -->
164 * This default implementation returns null so that we can easily ignore cases;
165 * it's useful to ignore a case when inheritance will catch all the cases anyway.
166 * <!-- end-user-doc -->
167 * @return the new adapter.
168 * @see com.hammurapi.party.CommonObject
169 * @generated
170 */
171 public Adapter createCommonObjectAdapter() {
172 return null;
173 }
174
175 /**
176 * Creates a new adapter for an object of class '{@link com.hammurapi.config.Factory <em>Factory</em>}'.
177 * <!-- begin-user-doc -->
178 * This default implementation returns null so that we can easily ignore cases;
179 * it's useful to ignore a case when inheritance will catch all the cases anyway.
180 * <!-- end-user-doc -->
181 * @return the new adapter.
182 * @see com.hammurapi.config.Factory
183 * @generated
184 */
185 public Adapter createFactoryAdapter() {
186 return null;
187 }
188
189 /**
190 * Creates a new adapter for an object of class '{@link com.hammurapi.config.Named <em>Named</em>}'.
191 * <!-- begin-user-doc -->
192 * This default implementation returns null so that we can easily ignore cases;
193 * it's useful to ignore a case when inheritance will catch all the cases anyway.
194 * <!-- end-user-doc -->
195 * @return the new adapter.
196 * @see com.hammurapi.config.Named
197 * @generated
198 */
199 public Adapter createNamedAdapter() {
200 return null;
201 }
202
203 /**
204 * Creates a new adapter for an object of class '{@link com.hammurapi.config.PropertySource <em>Property Source</em>}'.
205 * <!-- begin-user-doc -->
206 * This default implementation returns null so that we can easily ignore cases;
207 * it's useful to ignore a case when inheritance will catch all the cases anyway.
208 * <!-- end-user-doc -->
209 * @return the new adapter.
210 * @see com.hammurapi.config.PropertySource
211 * @generated
212 */
213 public Adapter createPropertySourceAdapter() {
214 return null;
215 }
216
217 /**
218 * Creates a new adapter for an object of class '{@link com.hammurapi.config.ObjectDefinition <em>Object Definition</em>}'.
219 * <!-- begin-user-doc -->
220 * This default implementation returns null so that we can easily ignore cases;
221 * it's useful to ignore a case when inheritance will catch all the cases anyway.
222 * <!-- end-user-doc -->
223 * @return the new adapter.
224 * @see com.hammurapi.config.ObjectDefinition
225 * @generated
226 */
227 public Adapter createObjectDefinitionAdapter() {
228 return null;
229 }
230
231 /**
232 * Creates a new adapter for an object of class '{@link com.hammurapi.config.NamedObjectDefinition <em>Named Object Definition</em>}'.
233 * <!-- begin-user-doc -->
234 * This default implementation returns null so that we can easily ignore cases;
235 * it's useful to ignore a case when inheritance will catch all the cases anyway.
236 * <!-- end-user-doc -->
237 * @return the new adapter.
238 * @see com.hammurapi.config.NamedObjectDefinition
239 * @generated
240 */
241 public Adapter createNamedObjectDefinitionAdapter() {
242 return null;
243 }
244
245 /**
246 * Creates a new adapter for the default case.
247 * <!-- begin-user-doc -->
248 * This default implementation returns null.
249 * <!-- end-user-doc -->
250 * @return the new adapter.
251 * @generated
252 */
253 public Adapter createEObjectAdapter() {
254 return null;
255 }
256
257 } //ModelAdapterFactory