blob: 11d69723f49ded7005a4eacb37d7a53ad8d839a9 [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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* 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("");
}
}