Examples of XExpression


Examples of org.eclipse.xtext.xbase.XExpression

          String _name = variable.getName();
          JvmTypeReference _typeRef_2 = RouteJvmModelInferrer.this._typeReferenceBuilder.typeRef(String.class);
          JvmFormalParameter _parameter_2 = RouteJvmModelInferrer.this._jvmTypesBuilder.toParameter(variable, _name, _typeRef_2);
          RouteJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2);
        }
        XExpression _call = route.getCall();
        RouteJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _call);
      }
    };
    return this._jvmTypesBuilder.toMethod(route, _nameOfRouteMethod, _typeRef, _function);
  }
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

          String _name = variable.getName();
          JvmTypeReference _typeRef_2 = RouteJvmModelInferrer.this._typeReferenceBuilder.typeRef(String.class);
          JvmFormalParameter _parameter_2 = RouteJvmModelInferrer.this._jvmTypesBuilder.toParameter(variable, _name, _typeRef_2);
          RouteJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_2);
        }
        XExpression _condition = route.getCondition();
        RouteJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _condition);
      }
    };
    return this._jvmTypesBuilder.toMethod(route, _plus, _typeRef, _function);
  }
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

                }
                _builder_1.append(");");
                final String routeMethodCall = _builder_1.toString();
                _builder.newLineIfNotEmpty();
                {
                  XExpression _condition = route.getCondition();
                  boolean _notEquals = (!Objects.equal(_condition, null));
                  if (_notEquals) {
                    _builder.append("\t\t");
                    _builder.append("if (");
                    String _nameOfRouteMethod_1 = RouteJvmModelInferrer.this.nameOfRouteMethod(route);
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

          }
        }
        EList<BindingAST> _bindings = module.getBindings();
        for (final BindingAST binding : _bindings) {
          {
            XExpression _toInstance = binding.getToInstance();
            boolean _notEquals = (!Objects.equal(_toInstance, null));
            if (_notEquals) {
              EList<JvmMember> _members_1 = it.getMembers();
              String _syntheticToInstanceName = GuiceModulesJvmModelInferrer.this.syntheticToInstanceName(binding);
              KeyAST _from = binding.getFrom();
              JvmTypeReference _type = _from.getType();
              final Procedure1<JvmOperation> _function_1 = new Procedure1<JvmOperation>() {
                public void apply(final JvmOperation it) {
                  it.setVisibility(JvmVisibility.PRIVATE);
                  XExpression _toInstance = binding.getToInstance();
                  GuiceModulesJvmModelInferrer.this.builder.setBody(it, _toInstance);
                }
              };
              JvmOperation _method = GuiceModulesJvmModelInferrer.this.builder.toMethod(binding, _syntheticToInstanceName, _type, _function_1);
              GuiceModulesJvmModelInferrer.this.builder.<JvmOperation>operator_add(_members_1, _method);
            }
            KeyAST _to = binding.getTo();
            XAnnotation _annotation = null;
            if (_to!=null) {
              _annotation=_to.getAnnotation();
            }
            boolean _notEquals_1 = (!Objects.equal(_annotation, null));
            if (_notEquals_1) {
              EList<JvmMember> _members_2 = it.getMembers();
              KeyAST _to_1 = binding.getTo();
              String _syntheticName = GuiceModulesJvmModelInferrer.this.syntheticName(_to_1);
              KeyAST _to_2 = binding.getTo();
              JvmTypeReference _type_1 = _to_2.getType();
              final Procedure1<JvmField> _function_2 = new Procedure1<JvmField>() {
                public void apply(final JvmField it) {
                  KeyAST _to = binding.getTo();
                  XAnnotation _annotation = _to.getAnnotation();
                  GuiceModulesJvmModelInferrer.this.builder.addAnnotation(it, _annotation);
                  it.setVisibility(JvmVisibility.PRIVATE);
                }
              };
              JvmField _field_1 = GuiceModulesJvmModelInferrer.this.builder.toField(binding, _syntheticName, _type_1, _function_2);
              GuiceModulesJvmModelInferrer.this.builder.<JvmField>operator_add(_members_2, _field_1);
            }
            KeyAST _from_1 = binding.getFrom();
            XAnnotation _annotation_1 = _from_1.getAnnotation();
            boolean _notEquals_2 = (!Objects.equal(_annotation_1, null));
            if (_notEquals_2) {
              EList<JvmMember> _members_3 = it.getMembers();
              KeyAST _from_2 = binding.getFrom();
              String _syntheticName_1 = GuiceModulesJvmModelInferrer.this.syntheticName(_from_2);
              KeyAST _from_3 = binding.getFrom();
              JvmTypeReference _type_2 = _from_3.getType();
              final Procedure1<JvmField> _function_3 = new Procedure1<JvmField>() {
                public void apply(final JvmField it) {
                  KeyAST _from = binding.getFrom();
                  XAnnotation _annotation = _from.getAnnotation();
                  GuiceModulesJvmModelInferrer.this.builder.addAnnotation(it, _annotation);
                  it.setVisibility(JvmVisibility.PRIVATE);
                }
              };
              JvmField _field_2 = GuiceModulesJvmModelInferrer.this.builder.toField(binding, _syntheticName_1, _type_2, _function_3);
              GuiceModulesJvmModelInferrer.this.builder.<JvmField>operator_add(_members_3, _field_2);
            }
          }
        }
        EList<JvmMember> _members_1 = it.getMembers();
        JvmTypeReference _typeRef_1 = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(void.class);
        final Procedure1<JvmOperation> _function_1 = new Procedure1<JvmOperation>() {
          public void apply(final JvmOperation it) {
            EList<JvmFormalParameter> _parameters = it.getParameters();
            JvmTypeReference _typeRef = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(Binder.class);
            JvmFormalParameter _parameter = GuiceModulesJvmModelInferrer.this.builder.toParameter(module, "binder", _typeRef);
            GuiceModulesJvmModelInferrer.this.builder.<JvmFormalParameter>operator_add(_parameters, _parameter);
            StringConcatenationClient _client = new StringConcatenationClient() {
              @Override
              protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
                _builder.append("configure(binder, new ");
                _builder.append(HashSet.class, "");
                _builder.append("<");
                JvmTypeReference _wildcard = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.wildcard();
                JvmTypeReference _typeRef = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(Key.class, _wildcard);
                _builder.append(_typeRef, "");
                _builder.append(">());");
                _builder.newLineIfNotEmpty();
              }
            };
            GuiceModulesJvmModelInferrer.this.builder.setBody(it, _client);
          }
        };
        JvmOperation _method = GuiceModulesJvmModelInferrer.this.builder.toMethod(module, "configure", _typeRef_1, _function_1);
        GuiceModulesJvmModelInferrer.this.builder.<JvmOperation>operator_add(_members_1, _method);
        EList<JvmMember> _members_2 = it.getMembers();
        JvmTypeReference _typeRef_2 = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(void.class);
        final Procedure1<JvmOperation> _function_2 = new Procedure1<JvmOperation>() {
          public void apply(final JvmOperation it) {
            GuiceModulesJvmModelInferrer.this.builder.setDocumentation(it, "Registers bindings for keys not present in the given set.");
            EList<JvmFormalParameter> _parameters = it.getParameters();
            JvmTypeReference _typeRef = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(Binder.class);
            JvmFormalParameter _parameter = GuiceModulesJvmModelInferrer.this.builder.toParameter(module, "bind", _typeRef);
            GuiceModulesJvmModelInferrer.this.builder.<JvmFormalParameter>operator_add(_parameters, _parameter);
            EList<JvmFormalParameter> _parameters_1 = it.getParameters();
            JvmTypeReference _wildcard = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.wildcard();
            JvmTypeReference _typeRef_1 = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(Key.class, _wildcard);
            JvmTypeReference _typeRef_2 = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(Set.class, _typeRef_1);
            JvmFormalParameter _parameter_1 = GuiceModulesJvmModelInferrer.this.builder.toParameter(module, "usedKeys", _typeRef_2);
            GuiceModulesJvmModelInferrer.this.builder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1);
            StringConcatenationClient _client = new StringConcatenationClient() {
              @Override
              protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
                _builder.append("try {");
                _builder.newLine();
                {
                  EList<BindingAST> _bindings = module.getBindings();
                  for(final BindingAST b : _bindings) {
                    _builder.append("\t");
                    _builder.append("{");
                    _builder.newLine();
                    _builder.append("\t");
                    _builder.append("\t");
                    KeyAST _from = b.getFrom();
                    JvmTypeReference _type = _from.getType();
                    JvmTypeReference _typeRef = GuiceModulesJvmModelInferrer.this._typeReferenceBuilder.typeRef(Key.class, _type);
                    _builder.append(_typeRef, "\t\t");
                    _builder.append(" key = ");
                    KeyAST _from_1 = b.getFrom();
                    StringConcatenationClient _guiceKey = GuiceModulesJvmModelInferrer.this.guiceKey(_from_1);
                    _builder.append(_guiceKey, "\t\t");
                    _builder.append(";");
                    _builder.newLineIfNotEmpty();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("if (usedKeys.add(key)) {");
                    _builder.newLine();
                    {
                      XExpression _toInstance = b.getToInstance();
                      boolean _notEquals = (!Objects.equal(_toInstance, null));
                      if (_notEquals) {
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("bind.bind(key).toInstance(");
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetDefaultexp(XExpression newDefaultexp, NotificationChain msgs)
  {
    XExpression oldDefaultexp = defaultexp;
    defaultexp = newDefaultexp;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TemplatePackage.PARAMETER__DEFAULTEXP, oldDefaultexp, newDefaultexp);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

            JvmTypeReference _elvis_1 = null;
            JvmTypeReference _type = declaredParameter.getType();
            if (_type != null) {
              _elvis_1 = _type;
            } else {
              XExpression _init = null;
              if (declaredParameter!=null) {
                _init=declaredParameter.getInit();
              }
              JvmTypeReference _inferredType = null;
              if (_init!=null) {
                _inferredType=BuildDSLJvmModelInferrer.this._jvmTypesBuilder.inferredType(_init);
              }
              _elvis_1 = _inferredType;
            }
            if (_elvis_1 != null) {
              _elvis = _elvis_1;
            } else {
              JvmTypeReference _typeRef_1 = BuildDSLJvmModelInferrer.this._typeReferenceBuilder.typeRef(String.class);
              _elvis = _typeRef_1;
            }
            final JvmTypeReference type = _elvis;
            EList<JvmMember> _members = it.getMembers();
            String _name = declaredParameter.getName();
            final Procedure1<JvmField> _function = new Procedure1<JvmField>() {
              public void apply(final JvmField it) {
                it.setVisibility(JvmVisibility.PUBLIC);
                EList<JvmAnnotationReference> _annotations = it.getAnnotations();
                JvmAnnotationReference _annotation = BuildDSLJvmModelInferrer.this._jvmTypesBuilder.toAnnotation(declaredParameter, Param.class);
                BuildDSLJvmModelInferrer.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotation);
                XExpression _init = declaredParameter.getInit();
                BuildDSLJvmModelInferrer.this._jvmTypesBuilder.setInitializer(it, _init);
              }
            };
            JvmField _field = BuildDSLJvmModelInferrer.this._jvmTypesBuilder.toField(declaredParameter, _name, type, _function);
            BuildDSLJvmModelInferrer.this._jvmTypesBuilder.<JvmField>operator_add(_members, _field);
          }
        }
        JvmTypeReference _typeRef_1 = BuildDSLJvmModelInferrer.this._typeReferenceBuilder.typeRef(String.class);
        final JvmTypeReference stringArray = BuildDSLJvmModelInferrer.this._jvmTypesBuilder.addArrayTypeDimension(_typeRef_1);
        EList<JvmMember> _members = it.getMembers();
        JvmTypeReference _typeRef_2 = BuildDSLJvmModelInferrer.this._typeReferenceBuilder.typeRef(Void.TYPE);
        final Procedure1<JvmOperation> _function = new Procedure1<JvmOperation>() {
          public void apply(final JvmOperation it) {
            EList<JvmFormalParameter> _parameters = it.getParameters();
            JvmFormalParameter _parameter = BuildDSLJvmModelInferrer.this._jvmTypesBuilder.toParameter(it, "args", stringArray);
            BuildDSLJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter);
            it.setVarArgs(true);
            it.setStatic(true);
            StringConcatenationClient _client = new StringConcatenationClient() {
              @Override
              protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
                _builder.append(simpleName, "");
                _builder.append(" script = new ");
                _builder.append(simpleName, "");
                _builder.append("();");
                _builder.newLineIfNotEmpty();
                _builder.append("if (script.showHelp(args)) {");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("System.exit(HELP);");
                _builder.newLine();
                _builder.append("}");
                _builder.newLine();
                _builder.append("System.exit(script.doBuild(args));");
                _builder.newLine();
              }
            };
            BuildDSLJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _client);
          }
        };
        JvmOperation _method = BuildDSLJvmModelInferrer.this._jvmTypesBuilder.toMethod(file, "main", _typeRef_2, _function);
        BuildDSLJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method);
        EList<JvmMember> _members_1 = it.getMembers();
        Iterable<Task> _tasks = BuildDSLJvmModelInferrer.this.getTasks(file);
        final Function1<Task, JvmOperation> _function_1 = new Function1<Task, JvmOperation>() {
          public JvmOperation apply(final Task task) {
            String _methodName = BuildDSLJvmModelInferrer.this.getMethodName(task);
            JvmTypeReference _typeRef = BuildDSLJvmModelInferrer.this._typeReferenceBuilder.typeRef(Void.TYPE);
            final Procedure1<JvmOperation> _function = new Procedure1<JvmOperation>() {
              public void apply(final JvmOperation it) {
                it.setVisibility(JvmVisibility.PROTECTED);
                EList<JvmAnnotationReference> _annotations = it.getAnnotations();
                EList<Task> _depends = task.getDepends();
                final Function1<Task, String> _function = new Function1<Task, String>() {
                  public String apply(final Task it) {
                    return it.getName();
                  }
                };
                List<String> _map = ListExtensions.<Task, String>map(_depends, _function);
                JvmAnnotationReference _annotationRef = BuildDSLJvmModelInferrer.this._annotationTypesBuilder.annotationRef(DependsOn.class, ((String[])Conversions.unwrapArray(_map, String.class)));
                BuildDSLJvmModelInferrer.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
                XExpression _action = task.getAction();
                BuildDSLJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _action);
              }
            };
            return BuildDSLJvmModelInferrer.this._jvmTypesBuilder.toMethod(task, _methodName, _typeRef, _function);
          }
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetBody(XExpression newBody, NotificationChain msgs)
  {
    XExpression oldBody = body;
    body = newBody;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelQueryLanguagePackage.XMETHOD_DECLARATION__BODY, oldBody, newBody);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

                    JvmFormalParameter _parameter = ModelQueryLanguageJvmModelInferrer.this._jvmTypesBuilder.toParameter(p, _name, _parameterType);
                    ModelQueryLanguageJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_1, _parameter);
                  }
                  EList<JvmTypeParameter> _typeParameters = op.getTypeParameters();
                  ModelQueryLanguageJvmModelInferrer.this.copyAndFixTypeParameters(_typeParameters, it);
                  XExpression _body = op.getBody();
                  ModelQueryLanguageJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _body);
                }
              };
            JvmOperation _method_1 = ModelQueryLanguageJvmModelInferrer.this._jvmTypesBuilder.toMethod(op, _name, _elvis, _function_1);
            ModelQueryLanguageJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_4, _method_1);
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetBody(XExpression newBody, NotificationChain msgs)
  {
    XExpression oldBody = body;
    body = newBody;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JexTestPackage.METHOD__BODY, oldBody, newBody);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.xbase.XExpression

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetExpr(XExpression newExpr, NotificationChain msgs)
  {
    XExpression oldExpr = expr;
    expr = newExpr;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JexTestPackage.TRANSITION_EXPRESSION_ACTION__EXPR, oldExpr, newExpr);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.