blob: 2a9127c5c8356e85c749c3656008d38c9ac6219e [file] [log] [blame]
cbridghaf654faf2005-02-13 16:27:46 +00001/*******************************************************************************
jlanutifed82ab2005-12-01 22:03:10 +00002 * Copyright (c) 2001, 2005 IBM Corporation and others.
cbridghaf654faf2005-02-13 16:27:46 +00003 * 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
jlanutifed82ab2005-12-01 22:03:10 +00007 *
cbridghaf654faf2005-02-13 16:27:46 +00008 * 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 */
cbridgha44a17d72005-04-04 07:05:01 +000017package org.eclipse.wst.common.componentcore.internal.util;
cbridghaf654faf2005-02-13 16:27:46 +000018
19import org.eclipse.emf.ecore.EObject;
cbridgha44a17d72005-04-04 07:05:01 +000020import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
21import org.eclipse.wst.common.componentcore.internal.DependencyType;
cbridghaf654faf2005-02-13 16:27:46 +000022import org.eclipse.wst.common.internal.emf.resource.Translator;
cbridghaf654faf2005-02-13 16:27:46 +000023
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 */
30public class DependencyTypeTranslator extends Translator implements WTPModulesXmlMapperI{
31
32 public DependencyTypeTranslator(){
cbridgha44a17d72005-04-04 07:05:01 +000033 super(DEPENDENCY_TYPE,ComponentcorePackage.eINSTANCE.getReferencedComponent_DependencyType());
cbridghaf654faf2005-02-13 16:27:46 +000034 }
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}