/*******************************************************************************
* Copyright (c) 2009, 2010 Progress Software Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.fusesource.tools.core.message.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.fusesource.tools.core.message.Body;
import org.fusesource.tools.core.message.DocumentRoot;
import org.fusesource.tools.core.message.Message;
import org.fusesource.tools.core.message.MessageFactory;
import org.fusesource.tools.core.message.MessagePackage;
import org.fusesource.tools.core.message.Properties;
import org.fusesource.tools.core.message.Property;
/**
* <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
*
* @generated
*/
public class MessageFactoryImpl extends EFactoryImpl implements MessageFactory {
/**
* Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static MessageFactory init() {
try {
MessageFactory theMessageFactory = (MessageFactory) EPackage.Registry.INSTANCE
.getEFactory("http://fuse.com/tools/message");
if (theMessageFactory != null) {
return theMessageFactory;
}
} catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new MessageFactoryImpl();
}
/**
* Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public MessageFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case MessagePackage.BODY:
return createBody();
case MessagePackage.DOCUMENT_ROOT:
return createDocumentRoot();
case MessagePackage.MESSAGE:
return createMessage();
case MessagePackage.PROPERTIES:
return createProperties();
case MessagePackage.PROPERTY:
return createProperty();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Body createBody() {
BodyImpl body = new BodyImpl();
return body;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public DocumentRoot createDocumentRoot() {
DocumentRootImpl documentRoot = new DocumentRootImpl();
return documentRoot;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Message createMessage() {
MessageImpl message = new MessageImpl();
return message;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Properties createProperties() {
PropertiesImpl properties = new PropertiesImpl();
return properties;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Property createProperty() {
PropertyImpl property = new PropertyImpl();
return property;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public MessagePackage getMessagePackage() {
return (MessagePackage) getEPackage();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @deprecated
* @generated
*/
@Deprecated
public static MessagePackage getPackage() {
return MessagePackage.eINSTANCE;
}
} // MessageFactoryImpl