All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.joynr.generator.interfaces.InterfaceGenerator Maven / Gradle / Ivy

There is a newer version: 0.9.3
Show newest version
package io.joynr.generator.interfaces;

import com.google.inject.Inject;
import io.joynr.generator.interfaces.InterfaceAsyncTemplate;
import io.joynr.generator.interfaces.InterfaceSubscriptionTemplate;
import io.joynr.generator.interfaces.InterfaceSyncTemplate;
import io.joynr.generator.interfaces.InterfacesTemplate;
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 InterfaceGenerator {
  @Inject
  @Extension
  private JoynrJavaGeneratorExtensions _joynrJavaGeneratorExtensions;
  
  @Inject
  private InterfacesTemplate interfaces;
  
  @Inject
  private InterfaceSyncTemplate interfaceSync;
  
  @Inject
  private InterfaceAsyncTemplate interfaceAsync;
  
  @Inject
  private InterfaceSubscriptionTemplate interfaceSubscription;
  
  public void doGenerate(final FInterface serviceInterface, final IFileSystemAccess fsa) {
    String _packagePathWithJoynrPrefix = this._joynrJavaGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, File.separator);
    final String path = (_packagePathWithJoynrPrefix + File.separator);
    String serviceName = this._joynrJavaGeneratorExtensions.joynrName(serviceInterface);
    String _plus = (path + serviceName);
    String _plus_1 = (_plus + ".java");
    CharSequence _generate = this.interfaces.generate(serviceInterface);
    String _string = _generate.toString();
    fsa.generateFile(_plus_1, _string);
    String _plus_2 = (path + serviceName);
    String _plus_3 = (_plus_2 + "Sync.java");
    CharSequence _generate_1 = this.interfaceSync.generate(serviceInterface);
    String _string_1 = _generate_1.toString();
    fsa.generateFile(_plus_3, _string_1);
    String _plus_4 = (path + serviceName);
    String _plus_5 = (_plus_4 + "Async.java");
    CharSequence _generate_2 = this.interfaceAsync.generate(serviceInterface);
    String _string_2 = _generate_2.toString();
    fsa.generateFile(_plus_5, _string_2);
    String _plus_6 = (path + serviceName);
    String _plus_7 = (_plus_6 + "SubscriptionInterface.java");
    CharSequence _generate_3 = this.interfaceSubscription.generate(serviceInterface);
    String _string_3 = _generate_3.toString();
    fsa.generateFile(_plus_7, _string_3);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy