io.joynr.generator.provider.ProviderGenerator Maven / Gradle / Ivy
package io.joynr.generator.provider;
import com.google.inject.Inject;
import io.joynr.generator.provider.InterfaceAbstractProviderTemplate;
import io.joynr.generator.provider.InterfaceProviderImplTemplate;
import io.joynr.generator.provider.InterfaceProviderTemplate;
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 ProviderGenerator {
@Inject
@Extension
private JoynrJavaGeneratorExtensions _joynrJavaGeneratorExtensions;
@Inject
private InterfaceProviderTemplate interfaceProvider;
@Inject
private InterfaceProviderImplTemplate interfaceProviderImpl;
@Inject
private InterfaceAbstractProviderTemplate interfaceAbstractProvider;
public void doGenerate(final FInterface fInterface, final IFileSystemAccess fsa) {
String _packagePathWithJoynrPrefix = this._joynrJavaGeneratorExtensions.getPackagePathWithJoynrPrefix(fInterface, File.separator);
final String path = (_packagePathWithJoynrPrefix + File.separator);
String serviceName = this._joynrJavaGeneratorExtensions.joynrName(fInterface);
String _plus = (path + serviceName);
String _plus_1 = (_plus + "Provider.java");
CharSequence _generate = this.interfaceProvider.generate(fInterface);
String _string = _generate.toString();
fsa.generateFile(_plus_1, _string);
String _plus_2 = (path + "Default");
String _plus_3 = (_plus_2 + serviceName);
String _plus_4 = (_plus_3 + "Provider.java");
CharSequence _generate_1 = this.interfaceProviderImpl.generate(fInterface);
String _string_1 = _generate_1.toString();
fsa.generateFile(_plus_4, _string_1);
String _plus_5 = (path + serviceName);
String _plus_6 = (_plus_5 + "AbstractProvider.java");
CharSequence _generate_2 = this.interfaceAbstractProvider.generate(fInterface);
String _string_2 = _generate_2.toString();
fsa.generateFile(_plus_6, _string_2);
}
}