001 /**
002 * <copyright>
003 * </copyright>
004 *
005 * $Id$
006 */
007 package com.hammurapi.party.impl;
008
009 import com.hammurapi.party.*;
010
011 import org.eclipse.emf.ecore.EClass;
012 import org.eclipse.emf.ecore.EObject;
013 import org.eclipse.emf.ecore.EPackage;
014
015 import org.eclipse.emf.ecore.impl.EFactoryImpl;
016
017 import org.eclipse.emf.ecore.plugin.EcorePlugin;
018
019 /**
020 * <!-- begin-user-doc -->
021 * An implementation of the model <b>Factory</b>.
022 * <!-- end-user-doc -->
023 * @generated
024 */
025 public class PartyFactoryImpl extends EFactoryImpl implements PartyFactory {
026 /**
027 * Creates the default factory implementation.
028 * <!-- begin-user-doc -->
029 * <!-- end-user-doc -->
030 * @generated
031 */
032 public static PartyFactory init() {
033 try {
034 PartyFactory thePartyFactory = (PartyFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.hammurapi.com/party");
035 if (thePartyFactory != null) {
036 return thePartyFactory;
037 }
038 }
039 catch (Exception exception) {
040 EcorePlugin.INSTANCE.log(exception);
041 }
042 return new PartyFactoryImpl();
043 }
044
045 /**
046 * Creates an instance of the factory.
047 * <!-- begin-user-doc -->
048 * <!-- end-user-doc -->
049 * @generated
050 */
051 public PartyFactoryImpl() {
052 super();
053 }
054
055 /**
056 * <!-- begin-user-doc -->
057 * <!-- end-user-doc -->
058 * @generated
059 */
060 @Override
061 public EObject create(EClass eClass) {
062 switch (eClass.getClassifierID()) {
063 case PartyPackage.IDENTITY: return createIdentity();
064 case PartyPackage.PHONE: return createPhone();
065 case PartyPackage.WEB: return createWeb();
066 case PartyPackage.EMAIL: return createEMail();
067 case PartyPackage.CUSTOM: return createCustom();
068 case PartyPackage.US_ADDRESS: return createUSAddress();
069 case PartyPackage.ORGANIZATION: return createOrganization();
070 case PartyPackage.PERSON: return createPerson();
071 case PartyPackage.TAG: return createTag();
072 case PartyPackage.ROLE: return createRole();
073 case PartyPackage.MATRIX_RELATIONSHIP: return createMatrixRelationship();
074 default:
075 throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
076 }
077 }
078
079 /**
080 * <!-- begin-user-doc -->
081 * <!-- end-user-doc -->
082 * @generated
083 */
084 public Identity createIdentity() {
085 IdentityImpl identity = new IdentityImpl();
086 return identity;
087 }
088
089 /**
090 * <!-- begin-user-doc -->
091 * <!-- end-user-doc -->
092 * @generated
093 */
094 public Phone createPhone() {
095 PhoneImpl phone = new PhoneImpl();
096 return phone;
097 }
098
099 /**
100 * <!-- begin-user-doc -->
101 * <!-- end-user-doc -->
102 * @generated
103 */
104 public Web createWeb() {
105 WebImpl web = new WebImpl();
106 return web;
107 }
108
109 /**
110 * <!-- begin-user-doc -->
111 * <!-- end-user-doc -->
112 * @generated
113 */
114 public EMail createEMail() {
115 EMailImpl eMail = new EMailImpl();
116 return eMail;
117 }
118
119 /**
120 * <!-- begin-user-doc -->
121 * <!-- end-user-doc -->
122 * @generated
123 */
124 public Custom createCustom() {
125 CustomImpl custom = new CustomImpl();
126 return custom;
127 }
128
129 /**
130 * <!-- begin-user-doc -->
131 * <!-- end-user-doc -->
132 * @generated
133 */
134 public USAddress createUSAddress() {
135 USAddressImpl usAddress = new USAddressImpl();
136 return usAddress;
137 }
138
139 /**
140 * <!-- begin-user-doc -->
141 * <!-- end-user-doc -->
142 * @generated
143 */
144 public Organization createOrganization() {
145 OrganizationImpl organization = new OrganizationImpl();
146 return organization;
147 }
148
149 /**
150 * <!-- begin-user-doc -->
151 * <!-- end-user-doc -->
152 * @generated
153 */
154 public Person createPerson() {
155 PersonImpl person = new PersonImpl();
156 return person;
157 }
158
159 /**
160 * <!-- begin-user-doc -->
161 * <!-- end-user-doc -->
162 * @generated
163 */
164 public Tag createTag() {
165 TagImpl tag = new TagImpl();
166 return tag;
167 }
168
169 /**
170 * <!-- begin-user-doc -->
171 * <!-- end-user-doc -->
172 * @generated
173 */
174 public Role createRole() {
175 RoleImpl role = new RoleImpl();
176 return role;
177 }
178
179 /**
180 * <!-- begin-user-doc -->
181 * <!-- end-user-doc -->
182 * @generated
183 */
184 public MatrixRelationship createMatrixRelationship() {
185 MatrixRelationshipImpl matrixRelationship = new MatrixRelationshipImpl();
186 return matrixRelationship;
187 }
188
189 /**
190 * <!-- begin-user-doc -->
191 * <!-- end-user-doc -->
192 * @generated
193 */
194 public PartyPackage getPartyPackage() {
195 return (PartyPackage)getEPackage();
196 }
197
198 /**
199 * <!-- begin-user-doc -->
200 * <!-- end-user-doc -->
201 * @deprecated
202 * @generated
203 */
204 @Deprecated
205 public static PartyPackage getPackage() {
206 return PartyPackage.eINSTANCE;
207 }
208
209 } //PartyFactoryImpl