cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
jlanuti | fed82ab | 2005-12-01 22:03:10 +0000 | [diff] [blame] | 2 | * Copyright (c) 2001, 2005 IBM Corporation and others. |
cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
jlanuti | fed82ab | 2005-12-01 22:03:10 +0000 | [diff] [blame] | 7 | * |
cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | *******************************************************************************/ |
| 11 | /* |
| 12 | * Created on Apr 2, 2003 |
| 13 | * |
| 14 | * To change the template for this generated file go to |
| 15 | * Window>Preferences>Java>Code Generation>Code and Comments |
| 16 | */ |
cbridgha | 44a17d7 | 2005-04-04 07:05:01 +0000 | [diff] [blame] | 17 | package org.eclipse.wst.common.componentcore.internal.util; |
cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 18 | |
| 19 | import org.eclipse.emf.ecore.EObject; |
cbridgha | 44a17d7 | 2005-04-04 07:05:01 +0000 | [diff] [blame] | 20 | import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage; |
| 21 | import org.eclipse.wst.common.componentcore.internal.DependencyType; |
cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 22 | import org.eclipse.wst.common.internal.emf.resource.Translator; |
cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * @author administrator |
| 26 | * |
| 27 | * To change the template for this generated type comment go to |
| 28 | * Window>Preferences>Java>Code Generation>Code and Comments |
| 29 | */ |
| 30 | public class DependencyTypeTranslator extends Translator implements WTPModulesXmlMapperI{ |
| 31 | |
| 32 | public DependencyTypeTranslator(){ |
cbridgha | 44a17d7 | 2005-04-04 07:05:01 +0000 | [diff] [blame] | 33 | super(DEPENDENCY_TYPE,ComponentcorePackage.eINSTANCE.getReferencedComponent_DependencyType()); |
cbridgha | f654faf | 2005-02-13 16:27:46 +0000 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | /* (non-Javadoc) |
| 37 | * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) |
| 38 | */ |
| 39 | public Object convertStringToValue(String strValue, EObject owner) { |
| 40 | String correct = strValue; |
| 41 | if (strValue.toUpperCase().equals("CONSUMES")) //$NON-NLS-1$ |
| 42 | correct = DependencyType.CONSUMES_LITERAL.getName(); |
| 43 | else if (strValue.toUpperCase().equals("USES")) //$NON-NLS-1$ |
| 44 | correct = DependencyType.USES_LITERAL.getName(); |
| 45 | |
| 46 | return super.convertStringToValue(correct, owner); |
| 47 | } |
| 48 | |
| 49 | } |