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

io.joynr.generator.proxy.InterfaceProxyTemplate Maven / Gradle / Ivy

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

import com.google.inject.Inject;
import io.joynr.generator.util.JoynrJavaGeneratorExtensions;
import io.joynr.generator.util.TemplateBase;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.franca.core.franca.FInterface;

@SuppressWarnings("all")
public class InterfaceProxyTemplate {
  @Inject
  @Extension
  private JoynrJavaGeneratorExtensions _joynrJavaGeneratorExtensions;
  
  @Inject
  @Extension
  private TemplateBase _templateBase;
  
  public CharSequence generate(final FInterface fInterface) {
    CharSequence _xblockexpression = null;
    {
      final String interfaceName = this._joynrJavaGeneratorExtensions.joynrName(fInterface);
      final String className = (interfaceName + "Proxy");
      final String asyncClassName = (interfaceName + "Async");
      final String syncClassName = (interfaceName + "Sync");
      final String subscriptionClassName = (interfaceName + "SubscriptionInterface");
      final String packagePath = this._joynrJavaGeneratorExtensions.getPackagePathWithJoynrPrefix(fInterface, ".");
      StringConcatenation _builder = new StringConcatenation();
      _builder.newLine();
      CharSequence _warning = this._templateBase.warning();
      _builder.append(_warning, "");
      _builder.append("   ");
      _builder.newLineIfNotEmpty();
      _builder.append("package ");
      _builder.append(packagePath, "");
      _builder.append(";  \t");
      _builder.newLineIfNotEmpty();
      _builder.append("\t");
      _builder.newLine();
      _builder.append("public interface ");
      _builder.append(className, "");
      _builder.append(" extends ");
      _builder.append(asyncClassName, "");
      _builder.append(", ");
      _builder.append(syncClassName, "");
      _builder.append(", ");
      _builder.append(subscriptionClassName, "");
      _builder.append(" {");
      _builder.newLineIfNotEmpty();
      _builder.append("    ");
      _builder.append("public static String INTERFACE_NAME = \"");
      String _packagePathWithoutJoynrPrefix = this._joynrJavaGeneratorExtensions.getPackagePathWithoutJoynrPrefix(fInterface, "/");
      _builder.append(_packagePathWithoutJoynrPrefix, "    ");
      _builder.append("/");
      String _lowerCase = interfaceName.toLowerCase();
      _builder.append(_lowerCase, "    ");
      _builder.append("\";");
      _builder.newLineIfNotEmpty();
      _builder.append("}");
      _builder.newLine();
      _xblockexpression = (_builder);
    }
    return _xblockexpression;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy