io.joynr.generator.proxy.ProxyGenerator Maven / Gradle / Ivy
The newest version!
package io.joynr.generator.proxy;
import com.google.inject.Inject;
import io.joynr.generator.templates.util.NamingUtil;
import io.joynr.generator.util.JavaTemplateFactory;
import io.joynr.generator.util.JoynrJavaGeneratorExtensions;
import java.io.File;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.xbase.lib.Extension;
import org.franca.core.franca.FInterface;
@SuppressWarnings("all")
public class ProxyGenerator {
@Inject
@Extension
private JoynrJavaGeneratorExtensions _joynrJavaGeneratorExtensions;
@Inject
@Extension
private NamingUtil _namingUtil;
@Inject
private JavaTemplateFactory templateFactory;
public void doGenerate(final FInterface fInterface, final IFileSystemAccess fsa, final boolean generateVersion) {
String _packagePathWithJoynrPrefix = this._joynrJavaGeneratorExtensions.getPackagePathWithJoynrPrefix(fInterface, File.separator, generateVersion);
final String path = (_packagePathWithJoynrPrefix + File.separator);
String serviceName = this._namingUtil.joynrName(fInterface);
InterfaceProxyTemplate interfaceProxyTemplate = this.templateFactory.createInterfaceProxyTemplate(fInterface);
this._joynrJavaGeneratorExtensions.generateFile(fsa,
((path + serviceName) + "Proxy.java"), interfaceProxyTemplate, generateVersion);
}
}