blob: 56694887b979fb5f00599ad24c5cc0b299da5c81 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* 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:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
package org.eclipse.osbp.xtext.datamartdsl.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.osbp.dsl.semantic.entity.LEntityReference;
import org.eclipse.osbp.xtext.datamartdsl.valueconverter.DatamartQualifiedNameProvider;
import org.eclipse.xtext.naming.QualifiedName;
import com.google.common.base.Function;
/**
* The Class LEntityRefFQNComputation.
*/
public class LEntityRefFQNComputation implements Function<EObject, QualifiedName> {
/** The qualified name provider. */
private DatamartQualifiedNameProvider qualifiedNameProvider = new DatamartQualifiedNameProvider();
/* (non-Javadoc)
* @see com.google.common.base.Function#apply(java.lang.Object)
*/
public QualifiedName apply(EObject from) {
if (from instanceof LEntityReference){
return qualifiedNameProvider.getFQN((LEntityReference)from);
}
return QualifiedName.create("");
}
}