001/**
002 * ******************************************************************************
003 * Copyright (c) 2018 Red Hat Inc
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *  *
009 * Contributors:
010 *     Jens Reimann - initial API and implementation
011 *  ******************************************************************************
012 */
013package de.dentrassi.varlink.idl.varlinkIdl.util;
014
015import de.dentrassi.varlink.idl.varlinkIdl.Arguments;
016import de.dentrassi.varlink.idl.varlinkIdl.Array;
017import de.dentrassi.varlink.idl.varlinkIdl.BasicType;
018import de.dentrassi.varlink.idl.varlinkIdl.Dictionary;
019import de.dentrassi.varlink.idl.varlinkIdl.ElementType;
020import de.dentrassi.varlink.idl.varlinkIdl.Field;
021import de.dentrassi.varlink.idl.varlinkIdl.Interface;
022import de.dentrassi.varlink.idl.varlinkIdl.Member;
023import de.dentrassi.varlink.idl.varlinkIdl.Method;
024import de.dentrassi.varlink.idl.varlinkIdl.Optional;
025import de.dentrassi.varlink.idl.varlinkIdl.Result;
026import de.dentrassi.varlink.idl.varlinkIdl.TypeAlias;
027import de.dentrassi.varlink.idl.varlinkIdl.TypeAliasDefinition;
028import de.dentrassi.varlink.idl.varlinkIdl.TypeReference;
029import de.dentrassi.varlink.idl.varlinkIdl.VarlinkIdlPackage;
030
031import org.eclipse.emf.common.notify.Adapter;
032import org.eclipse.emf.common.notify.Notifier;
033
034import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
035
036import org.eclipse.emf.ecore.EObject;
037
038/**
039 * <!-- begin-user-doc -->
040 * The <b>Adapter Factory</b> for the model.
041 * It provides an adapter <code>createXXX</code> method for each class of the model.
042 * <!-- end-user-doc -->
043 * @see de.dentrassi.varlink.idl.varlinkIdl.VarlinkIdlPackage
044 * @generated
045 */
046public class VarlinkIdlAdapterFactory extends AdapterFactoryImpl
047{
048  /**
049   * The cached model package.
050   * <!-- begin-user-doc -->
051   * <!-- end-user-doc -->
052   * @generated
053   */
054  protected static VarlinkIdlPackage modelPackage;
055
056  /**
057   * Creates an instance of the adapter factory.
058   * <!-- begin-user-doc -->
059   * <!-- end-user-doc -->
060   * @generated
061   */
062  public VarlinkIdlAdapterFactory()
063  {
064    if (modelPackage == null)
065    {
066      modelPackage = VarlinkIdlPackage.eINSTANCE;
067    }
068  }
069
070  /**
071   * Returns whether this factory is applicable for the type of the object.
072   * <!-- begin-user-doc -->
073   * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
074   * <!-- end-user-doc -->
075   * @return whether this factory is applicable for the type of the object.
076   * @generated
077   */
078  @Override
079  public boolean isFactoryForType(Object object)
080  {
081    if (object == modelPackage)
082    {
083      return true;
084    }
085    if (object instanceof EObject)
086    {
087      return ((EObject)object).eClass().getEPackage() == modelPackage;
088    }
089    return false;
090  }
091
092  /**
093   * The switch that delegates to the <code>createXXX</code> methods.
094   * <!-- begin-user-doc -->
095   * <!-- end-user-doc -->
096   * @generated
097   */
098  protected VarlinkIdlSwitch<Adapter> modelSwitch =
099    new VarlinkIdlSwitch<Adapter>()
100    {
101      @Override
102      public Adapter caseInterface(Interface object)
103      {
104        return createInterfaceAdapter();
105      }
106      @Override
107      public Adapter caseMember(Member object)
108      {
109        return createMemberAdapter();
110      }
111      @Override
112      public Adapter caseTypeAlias(TypeAlias object)
113      {
114        return createTypeAliasAdapter();
115      }
116      @Override
117      public Adapter caseTypeAliasDefinition(TypeAliasDefinition object)
118      {
119        return createTypeAliasDefinitionAdapter();
120      }
121      @Override
122      public Adapter caseEnum(de.dentrassi.varlink.idl.varlinkIdl.Enum object)
123      {
124        return createEnumAdapter();
125      }
126      @Override
127      public Adapter caseObject(de.dentrassi.varlink.idl.varlinkIdl.Object object)
128      {
129        return createObjectAdapter();
130      }
131      @Override
132      public Adapter caseField(Field object)
133      {
134        return createFieldAdapter();
135      }
136      @Override
137      public Adapter caseElementType(ElementType object)
138      {
139        return createElementTypeAdapter();
140      }
141      @Override
142      public Adapter caseArray(Array object)
143      {
144        return createArrayAdapter();
145      }
146      @Override
147      public Adapter caseDictionary(Dictionary object)
148      {
149        return createDictionaryAdapter();
150      }
151      @Override
152      public Adapter caseOptional(Optional object)
153      {
154        return createOptionalAdapter();
155      }
156      @Override
157      public Adapter caseTypeReference(TypeReference object)
158      {
159        return createTypeReferenceAdapter();
160      }
161      @Override
162      public Adapter caseBasicType(BasicType object)
163      {
164        return createBasicTypeAdapter();
165      }
166      @Override
167      public Adapter caseMethod(Method object)
168      {
169        return createMethodAdapter();
170      }
171      @Override
172      public Adapter caseArguments(Arguments object)
173      {
174        return createArgumentsAdapter();
175      }
176      @Override
177      public Adapter caseResult(Result object)
178      {
179        return createResultAdapter();
180      }
181      @Override
182      public Adapter caseError(de.dentrassi.varlink.idl.varlinkIdl.Error object)
183      {
184        return createErrorAdapter();
185      }
186      @Override
187      public Adapter defaultCase(EObject object)
188      {
189        return createEObjectAdapter();
190      }
191    };
192
193  /**
194   * Creates an adapter for the <code>target</code>.
195   * <!-- begin-user-doc -->
196   * <!-- end-user-doc -->
197   * @param target the object to adapt.
198   * @return the adapter for the <code>target</code>.
199   * @generated
200   */
201  @Override
202  public Adapter createAdapter(Notifier target)
203  {
204    return modelSwitch.doSwitch((EObject)target);
205  }
206
207
208  /**
209   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Interface <em>Interface</em>}'.
210   * <!-- begin-user-doc -->
211   * This default implementation returns null so that we can easily ignore cases;
212   * it's useful to ignore a case when inheritance will catch all the cases anyway.
213   * <!-- end-user-doc -->
214   * @return the new adapter.
215   * @see de.dentrassi.varlink.idl.varlinkIdl.Interface
216   * @generated
217   */
218  public Adapter createInterfaceAdapter()
219  {
220    return null;
221  }
222
223  /**
224   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Member <em>Member</em>}'.
225   * <!-- begin-user-doc -->
226   * This default implementation returns null so that we can easily ignore cases;
227   * it's useful to ignore a case when inheritance will catch all the cases anyway.
228   * <!-- end-user-doc -->
229   * @return the new adapter.
230   * @see de.dentrassi.varlink.idl.varlinkIdl.Member
231   * @generated
232   */
233  public Adapter createMemberAdapter()
234  {
235    return null;
236  }
237
238  /**
239   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.TypeAlias <em>Type Alias</em>}'.
240   * <!-- begin-user-doc -->
241   * This default implementation returns null so that we can easily ignore cases;
242   * it's useful to ignore a case when inheritance will catch all the cases anyway.
243   * <!-- end-user-doc -->
244   * @return the new adapter.
245   * @see de.dentrassi.varlink.idl.varlinkIdl.TypeAlias
246   * @generated
247   */
248  public Adapter createTypeAliasAdapter()
249  {
250    return null;
251  }
252
253  /**
254   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.TypeAliasDefinition <em>Type Alias Definition</em>}'.
255   * <!-- begin-user-doc -->
256   * This default implementation returns null so that we can easily ignore cases;
257   * it's useful to ignore a case when inheritance will catch all the cases anyway.
258   * <!-- end-user-doc -->
259   * @return the new adapter.
260   * @see de.dentrassi.varlink.idl.varlinkIdl.TypeAliasDefinition
261   * @generated
262   */
263  public Adapter createTypeAliasDefinitionAdapter()
264  {
265    return null;
266  }
267
268  /**
269   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Enum <em>Enum</em>}'.
270   * <!-- begin-user-doc -->
271   * This default implementation returns null so that we can easily ignore cases;
272   * it's useful to ignore a case when inheritance will catch all the cases anyway.
273   * <!-- end-user-doc -->
274   * @return the new adapter.
275   * @see de.dentrassi.varlink.idl.varlinkIdl.Enum
276   * @generated
277   */
278  public Adapter createEnumAdapter()
279  {
280    return null;
281  }
282
283  /**
284   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Object <em>Object</em>}'.
285   * <!-- begin-user-doc -->
286   * This default implementation returns null so that we can easily ignore cases;
287   * it's useful to ignore a case when inheritance will catch all the cases anyway.
288   * <!-- end-user-doc -->
289   * @return the new adapter.
290   * @see de.dentrassi.varlink.idl.varlinkIdl.Object
291   * @generated
292   */
293  public Adapter createObjectAdapter()
294  {
295    return null;
296  }
297
298  /**
299   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Field <em>Field</em>}'.
300   * <!-- begin-user-doc -->
301   * This default implementation returns null so that we can easily ignore cases;
302   * it's useful to ignore a case when inheritance will catch all the cases anyway.
303   * <!-- end-user-doc -->
304   * @return the new adapter.
305   * @see de.dentrassi.varlink.idl.varlinkIdl.Field
306   * @generated
307   */
308  public Adapter createFieldAdapter()
309  {
310    return null;
311  }
312
313  /**
314   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.ElementType <em>Element Type</em>}'.
315   * <!-- begin-user-doc -->
316   * This default implementation returns null so that we can easily ignore cases;
317   * it's useful to ignore a case when inheritance will catch all the cases anyway.
318   * <!-- end-user-doc -->
319   * @return the new adapter.
320   * @see de.dentrassi.varlink.idl.varlinkIdl.ElementType
321   * @generated
322   */
323  public Adapter createElementTypeAdapter()
324  {
325    return null;
326  }
327
328  /**
329   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Array <em>Array</em>}'.
330   * <!-- begin-user-doc -->
331   * This default implementation returns null so that we can easily ignore cases;
332   * it's useful to ignore a case when inheritance will catch all the cases anyway.
333   * <!-- end-user-doc -->
334   * @return the new adapter.
335   * @see de.dentrassi.varlink.idl.varlinkIdl.Array
336   * @generated
337   */
338  public Adapter createArrayAdapter()
339  {
340    return null;
341  }
342
343  /**
344   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Dictionary <em>Dictionary</em>}'.
345   * <!-- begin-user-doc -->
346   * This default implementation returns null so that we can easily ignore cases;
347   * it's useful to ignore a case when inheritance will catch all the cases anyway.
348   * <!-- end-user-doc -->
349   * @return the new adapter.
350   * @see de.dentrassi.varlink.idl.varlinkIdl.Dictionary
351   * @generated
352   */
353  public Adapter createDictionaryAdapter()
354  {
355    return null;
356  }
357
358  /**
359   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Optional <em>Optional</em>}'.
360   * <!-- begin-user-doc -->
361   * This default implementation returns null so that we can easily ignore cases;
362   * it's useful to ignore a case when inheritance will catch all the cases anyway.
363   * <!-- end-user-doc -->
364   * @return the new adapter.
365   * @see de.dentrassi.varlink.idl.varlinkIdl.Optional
366   * @generated
367   */
368  public Adapter createOptionalAdapter()
369  {
370    return null;
371  }
372
373  /**
374   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.TypeReference <em>Type Reference</em>}'.
375   * <!-- begin-user-doc -->
376   * This default implementation returns null so that we can easily ignore cases;
377   * it's useful to ignore a case when inheritance will catch all the cases anyway.
378   * <!-- end-user-doc -->
379   * @return the new adapter.
380   * @see de.dentrassi.varlink.idl.varlinkIdl.TypeReference
381   * @generated
382   */
383  public Adapter createTypeReferenceAdapter()
384  {
385    return null;
386  }
387
388  /**
389   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.BasicType <em>Basic Type</em>}'.
390   * <!-- begin-user-doc -->
391   * This default implementation returns null so that we can easily ignore cases;
392   * it's useful to ignore a case when inheritance will catch all the cases anyway.
393   * <!-- end-user-doc -->
394   * @return the new adapter.
395   * @see de.dentrassi.varlink.idl.varlinkIdl.BasicType
396   * @generated
397   */
398  public Adapter createBasicTypeAdapter()
399  {
400    return null;
401  }
402
403  /**
404   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Method <em>Method</em>}'.
405   * <!-- begin-user-doc -->
406   * This default implementation returns null so that we can easily ignore cases;
407   * it's useful to ignore a case when inheritance will catch all the cases anyway.
408   * <!-- end-user-doc -->
409   * @return the new adapter.
410   * @see de.dentrassi.varlink.idl.varlinkIdl.Method
411   * @generated
412   */
413  public Adapter createMethodAdapter()
414  {
415    return null;
416  }
417
418  /**
419   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Arguments <em>Arguments</em>}'.
420   * <!-- begin-user-doc -->
421   * This default implementation returns null so that we can easily ignore cases;
422   * it's useful to ignore a case when inheritance will catch all the cases anyway.
423   * <!-- end-user-doc -->
424   * @return the new adapter.
425   * @see de.dentrassi.varlink.idl.varlinkIdl.Arguments
426   * @generated
427   */
428  public Adapter createArgumentsAdapter()
429  {
430    return null;
431  }
432
433  /**
434   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Result <em>Result</em>}'.
435   * <!-- begin-user-doc -->
436   * This default implementation returns null so that we can easily ignore cases;
437   * it's useful to ignore a case when inheritance will catch all the cases anyway.
438   * <!-- end-user-doc -->
439   * @return the new adapter.
440   * @see de.dentrassi.varlink.idl.varlinkIdl.Result
441   * @generated
442   */
443  public Adapter createResultAdapter()
444  {
445    return null;
446  }
447
448  /**
449   * Creates a new adapter for an object of class '{@link de.dentrassi.varlink.idl.varlinkIdl.Error <em>Error</em>}'.
450   * <!-- begin-user-doc -->
451   * This default implementation returns null so that we can easily ignore cases;
452   * it's useful to ignore a case when inheritance will catch all the cases anyway.
453   * <!-- end-user-doc -->
454   * @return the new adapter.
455   * @see de.dentrassi.varlink.idl.varlinkIdl.Error
456   * @generated
457   */
458  public Adapter createErrorAdapter()
459  {
460    return null;
461  }
462
463  /**
464   * Creates a new adapter for the default case.
465   * <!-- begin-user-doc -->
466   * This default implementation returns null.
467   * <!-- end-user-doc -->
468   * @return the new adapter.
469   * @generated
470   */
471  public Adapter createEObjectAdapter()
472  {
473    return null;
474  }
475
476} //VarlinkIdlAdapterFactory