001/**
002 */
003package org.nasdanika.html.model.html.util;
004
005import org.eclipse.emf.ecore.EObject;
006import org.eclipse.emf.ecore.EPackage;
007
008import org.eclipse.emf.ecore.util.Switch;
009import org.nasdanika.common.Adaptable;
010import org.nasdanika.exec.content.Filter;
011
012import org.nasdanika.html.model.html.*;
013import org.nasdanika.ncore.Marked;
014import org.nasdanika.ncore.ModelElement;
015
016/**
017 * <!-- begin-user-doc -->
018 * The <b>Switch</b> for the model's inheritance hierarchy.
019 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
020 * to invoke the <code>caseXXX</code> method for each class of the model,
021 * starting with the actual class of the object
022 * and proceeding up the inheritance hierarchy
023 * until a non-null result is returned,
024 * which is the result of the switch.
025 * <!-- end-user-doc -->
026 * @see org.nasdanika.html.model.html.HtmlPackage
027 * @generated
028 */
029public class HtmlSwitch<T> extends Switch<T> {
030        /**
031         * The cached model package
032         * <!-- begin-user-doc -->
033         * <!-- end-user-doc -->
034         * @generated
035         */
036        protected static HtmlPackage modelPackage;
037
038        /**
039         * Creates an instance of the switch.
040         * <!-- begin-user-doc -->
041         * <!-- end-user-doc -->
042         * @generated
043         */
044        public HtmlSwitch() {
045                if (modelPackage == null) {
046                        modelPackage = HtmlPackage.eINSTANCE;
047                }
048        }
049
050        /**
051         * Checks whether this is a switch for the given package.
052         * <!-- begin-user-doc -->
053         * <!-- end-user-doc -->
054         * @param ePackage the package in question.
055         * @return whether this is a switch for the given package.
056         * @generated
057         */
058        @Override
059        protected boolean isSwitchFor(EPackage ePackage) {
060                return ePackage == modelPackage;
061        }
062
063        /**
064         * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
065         * <!-- begin-user-doc -->
066         * <!-- end-user-doc -->
067         * @return the first non-null result returned by a <code>caseXXX</code> call.
068         * @generated
069         */
070        @Override
071        protected T doSwitch(int classifierID, EObject theEObject) {
072                switch (classifierID) {
073                        case HtmlPackage.HTML_ELEMENT: {
074                                HtmlElement htmlElement = (HtmlElement)theEObject;
075                                T result = caseHtmlElement(htmlElement);
076                                if (result == null) result = caseModelElement(htmlElement);
077                                if (result == null) result = caseMarked(htmlElement);
078                                if (result == null) result = caseAdaptable(htmlElement);
079                                if (result == null) result = caseIMarked(htmlElement);
080                                if (result == null) result = defaultCase(theEObject);
081                                return result;
082                        }
083                        case HtmlPackage.TAG: {
084                                Tag tag = (Tag)theEObject;
085                                T result = caseTag(tag);
086                                if (result == null) result = caseHtmlElement(tag);
087                                if (result == null) result = caseModelElement(tag);
088                                if (result == null) result = caseMarked(tag);
089                                if (result == null) result = caseAdaptable(tag);
090                                if (result == null) result = caseIMarked(tag);
091                                if (result == null) result = defaultCase(theEObject);
092                                return result;
093                        }
094                        case HtmlPackage.PAGE: {
095                                Page page = (Page)theEObject;
096                                T result = casePage(page);
097                                if (result == null) result = caseModelElement(page);
098                                if (result == null) result = caseMarked(page);
099                                if (result == null) result = caseAdaptable(page);
100                                if (result == null) result = caseIMarked(page);
101                                if (result == null) result = defaultCase(theEObject);
102                                return result;
103                        }
104                        case HtmlPackage.STYLESHEET: {
105                                Stylesheet stylesheet = (Stylesheet)theEObject;
106                                T result = caseStylesheet(stylesheet);
107                                if (result == null) result = caseFilter(stylesheet);
108                                if (result == null) result = caseModelElement(stylesheet);
109                                if (result == null) result = caseMarked(stylesheet);
110                                if (result == null) result = caseAdaptable(stylesheet);
111                                if (result == null) result = caseIMarked(stylesheet);
112                                if (result == null) result = defaultCase(theEObject);
113                                return result;
114                        }
115                        case HtmlPackage.STYLESHEET_REFERENCE: {
116                                StylesheetReference stylesheetReference = (StylesheetReference)theEObject;
117                                T result = caseStylesheetReference(stylesheetReference);
118                                if (result == null) result = caseModelElement(stylesheetReference);
119                                if (result == null) result = caseMarked(stylesheetReference);
120                                if (result == null) result = caseAdaptable(stylesheetReference);
121                                if (result == null) result = caseIMarked(stylesheetReference);
122                                if (result == null) result = defaultCase(theEObject);
123                                return result;
124                        }
125                        case HtmlPackage.SCRIPT: {
126                                Script script = (Script)theEObject;
127                                T result = caseScript(script);
128                                if (result == null) result = caseFilter(script);
129                                if (result == null) result = caseModelElement(script);
130                                if (result == null) result = caseMarked(script);
131                                if (result == null) result = caseAdaptable(script);
132                                if (result == null) result = caseIMarked(script);
133                                if (result == null) result = defaultCase(theEObject);
134                                return result;
135                        }
136                        case HtmlPackage.SCRIPT_REFERENCE: {
137                                ScriptReference scriptReference = (ScriptReference)theEObject;
138                                T result = caseScriptReference(scriptReference);
139                                if (result == null) result = caseModelElement(scriptReference);
140                                if (result == null) result = caseMarked(scriptReference);
141                                if (result == null) result = caseAdaptable(scriptReference);
142                                if (result == null) result = caseIMarked(scriptReference);
143                                if (result == null) result = defaultCase(theEObject);
144                                return result;
145                        }
146                        default: return defaultCase(theEObject);
147                }
148        }
149
150        /**
151         * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
152         * <!-- begin-user-doc -->
153         * This implementation returns null;
154         * returning a non-null result will terminate the switch.
155         * <!-- end-user-doc -->
156         * @param object the target of the switch.
157         * @return the result of interpreting the object as an instance of '<em>Element</em>'.
158         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
159         * @generated
160         */
161        public T caseHtmlElement(HtmlElement object) {
162                return null;
163        }
164
165        /**
166         * Returns the result of interpreting the object as an instance of '<em>Tag</em>'.
167         * <!-- begin-user-doc -->
168         * This implementation returns null;
169         * returning a non-null result will terminate the switch.
170         * <!-- end-user-doc -->
171         * @param object the target of the switch.
172         * @return the result of interpreting the object as an instance of '<em>Tag</em>'.
173         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
174         * @generated
175         */
176        public T caseTag(Tag object) {
177                return null;
178        }
179
180        /**
181         * Returns the result of interpreting the object as an instance of '<em>Page</em>'.
182         * <!-- begin-user-doc -->
183         * This implementation returns null;
184         * returning a non-null result will terminate the switch.
185         * <!-- end-user-doc -->
186         * @param object the target of the switch.
187         * @return the result of interpreting the object as an instance of '<em>Page</em>'.
188         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
189         * @generated
190         */
191        public T casePage(Page object) {
192                return null;
193        }
194
195        /**
196         * Returns the result of interpreting the object as an instance of '<em>Stylesheet</em>'.
197         * <!-- begin-user-doc -->
198         * This implementation returns null;
199         * returning a non-null result will terminate the switch.
200         * <!-- end-user-doc -->
201         * @param object the target of the switch.
202         * @return the result of interpreting the object as an instance of '<em>Stylesheet</em>'.
203         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
204         * @generated
205         */
206        public T caseStylesheet(Stylesheet object) {
207                return null;
208        }
209
210        /**
211         * Returns the result of interpreting the object as an instance of '<em>Stylesheet Reference</em>'.
212         * <!-- begin-user-doc -->
213         * This implementation returns null;
214         * returning a non-null result will terminate the switch.
215         * <!-- end-user-doc -->
216         * @param object the target of the switch.
217         * @return the result of interpreting the object as an instance of '<em>Stylesheet Reference</em>'.
218         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
219         * @generated
220         */
221        public T caseStylesheetReference(StylesheetReference object) {
222                return null;
223        }
224
225        /**
226         * Returns the result of interpreting the object as an instance of '<em>Script</em>'.
227         * <!-- begin-user-doc -->
228         * This implementation returns null;
229         * returning a non-null result will terminate the switch.
230         * <!-- end-user-doc -->
231         * @param object the target of the switch.
232         * @return the result of interpreting the object as an instance of '<em>Script</em>'.
233         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
234         * @generated
235         */
236        public T caseScript(Script object) {
237                return null;
238        }
239
240        /**
241         * Returns the result of interpreting the object as an instance of '<em>Script Reference</em>'.
242         * <!-- begin-user-doc -->
243         * This implementation returns null;
244         * returning a non-null result will terminate the switch.
245         * <!-- end-user-doc -->
246         * @param object the target of the switch.
247         * @return the result of interpreting the object as an instance of '<em>Script Reference</em>'.
248         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
249         * @generated
250         */
251        public T caseScriptReference(ScriptReference object) {
252                return null;
253        }
254
255        /**
256         * Returns the result of interpreting the object as an instance of '<em>IMarked</em>'.
257         * <!-- begin-user-doc -->
258         * This implementation returns null;
259         * returning a non-null result will terminate the switch.
260         * <!-- end-user-doc -->
261         * @param object the target of the switch.
262         * @return the result of interpreting the object as an instance of '<em>IMarked</em>'.
263         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
264         * @generated
265         */
266        public T caseIMarked(org.nasdanika.common.persistence.Marked object) {
267                return null;
268        }
269
270        /**
271         * Returns the result of interpreting the object as an instance of '<em>Marked</em>'.
272         * <!-- begin-user-doc -->
273         * This implementation returns null;
274         * returning a non-null result will terminate the switch.
275         * <!-- end-user-doc -->
276         * @param object the target of the switch.
277         * @return the result of interpreting the object as an instance of '<em>Marked</em>'.
278         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
279         * @generated
280         */
281        public T caseMarked(Marked object) {
282                return null;
283        }
284
285        /**
286         * Returns the result of interpreting the object as an instance of '<em>Adaptable</em>'.
287         * <!-- begin-user-doc -->
288         * This implementation returns null;
289         * returning a non-null result will terminate the switch.
290         * <!-- end-user-doc -->
291         * @param object the target of the switch.
292         * @return the result of interpreting the object as an instance of '<em>Adaptable</em>'.
293         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
294         * @generated
295         */
296        public T caseAdaptable(Adaptable object) {
297                return null;
298        }
299
300        /**
301         * Returns the result of interpreting the object as an instance of '<em>Model Element</em>'.
302         * <!-- begin-user-doc -->
303         * This implementation returns null;
304         * returning a non-null result will terminate the switch.
305         * <!-- end-user-doc -->
306         * @param object the target of the switch.
307         * @return the result of interpreting the object as an instance of '<em>Model Element</em>'.
308         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
309         * @generated
310         */
311        public T caseModelElement(ModelElement object) {
312                return null;
313        }
314
315        /**
316         * Returns the result of interpreting the object as an instance of '<em>Filter</em>'.
317         * <!-- begin-user-doc -->
318         * This implementation returns null;
319         * returning a non-null result will terminate the switch.
320         * <!-- end-user-doc -->
321         * @param object the target of the switch.
322         * @return the result of interpreting the object as an instance of '<em>Filter</em>'.
323         * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
324         * @generated
325         */
326        public T caseFilter(Filter object) {
327                return null;
328        }
329
330        /**
331         * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
332         * <!-- begin-user-doc -->
333         * This implementation returns null;
334         * returning a non-null result will terminate the switch, but this is the last case anyway.
335         * <!-- end-user-doc -->
336         * @param object the target of the switch.
337         * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
338         * @see #doSwitch(org.eclipse.emf.ecore.EObject)
339         * @generated
340         */
341        @Override
342        public T defaultCase(EObject object) {
343                return null;
344        }
345
346} //HtmlSwitch