diff options
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/CommonFactory.java')
-rw-r--r-- | common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/CommonFactory.java | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/CommonFactory.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/CommonFactory.java new file mode 100644 index 0000000000..254d60e239 --- /dev/null +++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/CommonFactory.java @@ -0,0 +1,115 @@ +/******************************************************************************* + * Copyright (c) 2009, 2010 Oracle. + * 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 + * + * Contributors: + * Oracle - initial API and implementation + *******************************************************************************/ + +package org.eclipse.jpt.common.core.resource.xml; + +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; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * <!-- end-user-doc --> + * @see org.eclipse.jpt.common.core.resource.xml.CommonPackage + * @generated + */ +public class CommonFactory extends EFactoryImpl +{ + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final CommonFactory eINSTANCE = init(); + + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static CommonFactory init() + { + try + { + CommonFactory theCommonFactory = (CommonFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.common.xmi"); + if (theCommonFactory != null) + { + return theCommonFactory; + } + } + catch (Exception exception) + { + EcorePlugin.INSTANCE.log(exception); + } + return new CommonFactory(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public CommonFactory() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) + { + switch (eClass.getClassifierID()) + { + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public CommonPackage getCommonPackage() + { + return (CommonPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static CommonPackage getPackage() + { + return CommonPackage.eINSTANCE; + } + +} //CommonFactory |