001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess.impl;
007:
008: import newprocess.Actor;
009: import newprocess.AndOperator;
010: import newprocess.AsyncActivity;
011: import newprocess.Conclusion;
012: import newprocess.Condition;
013: import newprocess.ConditionProxy;
014: import newprocess.ConditionTerm;
015: import newprocess.Direction;
016: import newprocess.Element;
017: import newprocess.EnvEntry;
018: import newprocess.Event;
019: import newprocess.Expansion;
020: import newprocess.Expression;
021: import newprocess.Globals;
022: import newprocess.Listener;
023: import newprocess.Loader;
024: import newprocess.Message;
025: import newprocess.NewprocessFactory;
026: import newprocess.NewprocessPackage;
027: import newprocess.OperatorTerm;
028: import newprocess.OrOperator;
029: import newprocess.Root;
030: import newprocess.SyncActivity;
031: import newprocess.Term;
032: import newprocess.adapter.ConditionTermAdapter;
033: import newprocess.adapter.OperatorAdapter;
034: import newprocess.adapter.ProxyAdapter;
035: import newprocess.adapter.RootTermAdapter;
036:
037: import org.eclipse.emf.ecore.EClass;
038: import org.eclipse.emf.ecore.EDataType;
039: import org.eclipse.emf.ecore.EObject;
040: import org.eclipse.emf.ecore.EPackage;
041: import org.eclipse.emf.ecore.impl.EFactoryImpl;
042: import org.eclipse.emf.ecore.plugin.EcorePlugin;
043:
044: /**
045: * <!-- begin-user-doc -->
046: * An implementation of the model <b>Factory</b>.
047: * <!-- end-user-doc -->
048: * @generated
049: */
050: public class NewprocessFactoryImpl extends EFactoryImpl implements
051: NewprocessFactory {
052: /**
053: * Creates the default factory implementation.
054: * <!-- begin-user-doc -->
055: * <!-- end-user-doc -->
056: * @generated
057: */
058: public static NewprocessFactory init() {
059: try {
060: NewprocessFactory theNewprocessFactory = (NewprocessFactory) EPackage.Registry.INSTANCE
061: .getEFactory("http://www.wilken.de/mod/newprocess");
062: if (theNewprocessFactory != null) {
063: return theNewprocessFactory;
064: }
065: } catch (Exception exception) {
066: EcorePlugin.INSTANCE.log(exception);
067: }
068: return new NewprocessFactoryImpl();
069: }
070:
071: /**
072: * Creates an instance of the factory.
073: * <!-- begin-user-doc -->
074: * <!-- end-user-doc -->
075: * @generated
076: */
077: public NewprocessFactoryImpl() {
078: super ();
079: }
080:
081: /**
082: * <!-- begin-user-doc -->
083: * <!-- end-user-doc -->
084: * @generated
085: */
086: @Override
087: public EObject create(EClass eClass) {
088: switch (eClass.getClassifierID()) {
089: case NewprocessPackage.PROCESS:
090: return createProcess();
091: case NewprocessPackage.CONDITION:
092: return createCondition();
093: case NewprocessPackage.ELEMENT:
094: return createElement();
095: case NewprocessPackage.SYNC_ACTIVITY:
096: return createSyncActivity();
097: case NewprocessPackage.LOADER:
098: return createLoader();
099: case NewprocessPackage.ASYNC_ACTIVITY:
100: return createAsyncActivity();
101: case NewprocessPackage.EVENT:
102: return createEvent();
103: case NewprocessPackage.ACTOR:
104: return createActor();
105: case NewprocessPackage.LISTENER:
106: return createListener();
107: case NewprocessPackage.ENV_ENTRY:
108: return createEnvEntry();
109: case NewprocessPackage.MESSAGE:
110: return createMessage();
111: case NewprocessPackage.CONDITION_PROXY:
112: return createConditionProxy();
113: case NewprocessPackage.CONCLUSION:
114: return createConclusion();
115: case NewprocessPackage.EXPANSION:
116: return createExpansion();
117: case NewprocessPackage.EXPRESSION:
118: return createExpression();
119: case NewprocessPackage.TERM:
120: return createTerm();
121: case NewprocessPackage.CONDITION_TERM:
122: return createConditionTerm();
123: case NewprocessPackage.OPERATOR_TERM:
124: return createOperatorTerm();
125: case NewprocessPackage.OR_OPERATOR:
126: return createOrOperator();
127: case NewprocessPackage.AND_OPERATOR:
128: return createAndOperator();
129: case NewprocessPackage.ROOT:
130: return createRoot();
131: case NewprocessPackage.GLOBALS:
132: return createGlobals();
133: default:
134: throw new IllegalArgumentException("The class '"
135: + eClass.getName() + "' is not a valid classifier");
136: }
137: }
138:
139: /**
140: * <!-- begin-user-doc -->
141: * <!-- end-user-doc -->
142: * @generated
143: */
144: @Override
145: public Object createFromString(EDataType eDataType,
146: String initialValue) {
147: switch (eDataType.getClassifierID()) {
148: case NewprocessPackage.DIRECTION:
149: return createDirectionFromString(eDataType, initialValue);
150: default:
151: throw new IllegalArgumentException("The datatype '"
152: + eDataType.getName()
153: + "' is not a valid classifier");
154: }
155: }
156:
157: /**
158: * <!-- begin-user-doc -->
159: * <!-- end-user-doc -->
160: * @generated
161: */
162: @Override
163: public String convertToString(EDataType eDataType,
164: Object instanceValue) {
165: switch (eDataType.getClassifierID()) {
166: case NewprocessPackage.DIRECTION:
167: return convertDirectionToString(eDataType, instanceValue);
168: default:
169: throw new IllegalArgumentException("The datatype '"
170: + eDataType.getName()
171: + "' is not a valid classifier");
172: }
173: }
174:
175: /**
176: * <!-- begin-user-doc -->
177: * <!-- end-user-doc -->
178: * @generated
179: */
180: public newprocess.Process createProcess() {
181: ProcessImpl process = new ProcessImpl();
182: return process;
183: }
184:
185: /**
186: * <!-- begin-user-doc -->
187: * <!-- end-user-doc -->
188: * @generated
189: */
190: public Condition createCondition() {
191: ConditionImpl condition = new ConditionImpl();
192: return condition;
193: }
194:
195: /**
196: * <!-- begin-user-doc -->
197: * <!-- end-user-doc -->
198: * @generated
199: */
200: public Element createElement() {
201: ElementImpl element = new ElementImpl();
202: return element;
203: }
204:
205: /**
206: * <!-- begin-user-doc -->
207: * <!-- end-user-doc -->
208: * @generated
209: */
210: public SyncActivity createSyncActivity() {
211: SyncActivityImpl syncActivity = new SyncActivityImpl();
212: return syncActivity;
213: }
214:
215: /**
216: * <!-- begin-user-doc -->
217: * <!-- end-user-doc -->
218: * @generated
219: */
220: public Loader createLoader() {
221: LoaderImpl loader = new LoaderImpl();
222: return loader;
223: }
224:
225: /**
226: * <!-- begin-user-doc -->
227: * <!-- end-user-doc -->
228: * @generated
229: */
230: public AsyncActivity createAsyncActivity() {
231: AsyncActivityImpl asyncActivity = new AsyncActivityImpl();
232: return asyncActivity;
233: }
234:
235: /**
236: * <!-- begin-user-doc -->
237: * <!-- end-user-doc -->
238: * @generated
239: */
240: public Event createEvent() {
241: EventImpl event = new EventImpl();
242: return event;
243: }
244:
245: /**
246: * <!-- begin-user-doc -->
247: * <!-- end-user-doc -->
248: * @generated
249: */
250: public Actor createActor() {
251: ActorImpl actor = new ActorImpl();
252: return actor;
253: }
254:
255: /**
256: * <!-- begin-user-doc -->
257: * <!-- end-user-doc -->
258: * @generated
259: */
260: public Listener createListener() {
261: ListenerImpl listener = new ListenerImpl();
262: return listener;
263: }
264:
265: /**
266: * <!-- begin-user-doc -->
267: * <!-- end-user-doc -->
268: * @generated
269: */
270: public EnvEntry createEnvEntry() {
271: EnvEntryImpl envEntry = new EnvEntryImpl();
272: return envEntry;
273: }
274:
275: /**
276: * <!-- begin-user-doc -->
277: * <!-- end-user-doc -->
278: * @generated
279: */
280: public Message createMessage() {
281: MessageImpl message = new MessageImpl();
282: return message;
283: }
284:
285: /**
286: * <!-- begin-user-doc -->
287: * <!-- end-user-doc -->
288: * @generated NOT
289: * @author sh
290: */
291: public ConditionProxy createConditionProxy() {
292: ConditionProxyImpl conditionProxy = new ConditionProxyImpl();
293: conditionProxy.eAdapters().add(ProxyAdapter.INSTANCE); // register adapter
294: return conditionProxy;
295: }
296:
297: /**
298: * <!-- begin-user-doc -->
299: * <!-- end-user-doc -->
300: * @generated
301: */
302: public Conclusion createConclusion() {
303: ConclusionImpl conclusion = new ConclusionImpl();
304: return conclusion;
305: }
306:
307: /**
308: * <!-- begin-user-doc -->
309: * <!-- end-user-doc -->
310: * @generated
311: */
312: public Expansion createExpansion() {
313: ExpansionImpl expansion = new ExpansionImpl();
314: return expansion;
315: }
316:
317: /**
318: * <!-- begin-user-doc -->
319: * <!-- end-user-doc -->
320: * @generated
321: */
322: public Expression createExpression() {
323: ExpressionImpl expression = new ExpressionImpl();
324: return expression;
325: }
326:
327: /**
328: * <!-- begin-user-doc -->
329: * <!-- end-user-doc -->
330: * @generated
331: */
332: public Term createTerm() {
333: TermImpl term = new TermImpl();
334: return term;
335: }
336:
337: /**
338: * <!-- begin-user-doc -->
339: * <!-- end-user-doc -->
340: * @generated NOT
341: * @author sh
342: */
343: public ConditionTerm createConditionTerm() {
344: ConditionTermImpl conditionTerm = new ConditionTermImpl();
345: conditionTerm.eAdapters().add(ConditionTermAdapter.INSTANCE); // register adapter
346: return conditionTerm;
347: }
348:
349: /**
350: * <!-- begin-user-doc -->
351: * <!-- end-user-doc -->
352: * @generated
353: */
354: public OperatorTerm createOperatorTerm() {
355: OperatorTermImpl operatorTerm = new OperatorTermImpl();
356: return operatorTerm;
357: }
358:
359: /**
360: * <!-- begin-user-doc -->
361: * <!-- end-user-doc -->
362: * @generated NOT
363: * @author sh
364: */
365: public OrOperator createOrOperator() {
366: OrOperatorImpl orOperator = new OrOperatorImpl();
367: orOperator.eAdapters().add(OperatorAdapter.INSTANCE); // register adapter
368: return orOperator;
369: }
370:
371: /**
372: * <!-- begin-user-doc -->
373: * <!-- end-user-doc -->
374: * @generated NOT
375: * @author sh
376: */
377: public AndOperator createAndOperator() {
378: AndOperatorImpl andOperator = new AndOperatorImpl();
379: andOperator.eAdapters().add(OperatorAdapter.INSTANCE); // register adapter
380: return andOperator;
381: }
382:
383: /**
384: * <!-- begin-user-doc -->
385: * <!-- end-user-doc -->
386: * @generated NOT
387: * @author sh
388: */
389: public Root createRoot() {
390: RootImpl root = new RootImpl();
391: root.eAdapters().add(RootTermAdapter.INSTANCE); // register adapter
392: return root;
393: }
394:
395: /**
396: * <!-- begin-user-doc -->
397: * <!-- end-user-doc -->
398: * @generated
399: */
400: public Globals createGlobals() {
401: GlobalsImpl globals = new GlobalsImpl();
402: return globals;
403: }
404:
405: /**
406: * <!-- begin-user-doc -->
407: * <!-- end-user-doc -->
408: * @generated
409: */
410: public Direction createDirectionFromString(EDataType eDataType,
411: String initialValue) {
412: Direction result = Direction.get(initialValue);
413: if (result == null)
414: throw new IllegalArgumentException("The value '"
415: + initialValue + "' is not a valid enumerator of '"
416: + eDataType.getName() + "'");
417: return result;
418: }
419:
420: /**
421: * <!-- begin-user-doc -->
422: * <!-- end-user-doc -->
423: * @generated
424: */
425: public String convertDirectionToString(EDataType eDataType,
426: Object instanceValue) {
427: return instanceValue == null ? null : instanceValue.toString();
428: }
429:
430: /**
431: * <!-- begin-user-doc -->
432: * <!-- end-user-doc -->
433: * @generated
434: */
435: public NewprocessPackage getNewprocessPackage() {
436: return (NewprocessPackage) getEPackage();
437: }
438:
439: /**
440: * <!-- begin-user-doc -->
441: * <!-- end-user-doc -->
442: * @deprecated
443: * @generated
444: */
445: @Deprecated
446: public static NewprocessPackage getPackage() {
447: return NewprocessPackage.eINSTANCE;
448: }
449:
450: } //NewprocessFactoryImpl
|