Examples of KeyAST


Examples of org.xtext.guicemodules.guiceModules.KeyAST

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetFrom(KeyAST newFrom, NotificationChain msgs)
  {
    KeyAST oldFrom = from;
    from = newFrom;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GuiceModulesPackage.BINDING_AST__FROM, oldFrom, newFrom);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.xtext.guicemodules.guiceModules.KeyAST

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetTo(KeyAST newTo, NotificationChain msgs)
  {
    KeyAST oldTo = to;
    to = newTo;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GuiceModulesPackage.BINDING_AST__TO, oldTo, newTo);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.xtext.guicemodules.guiceModules.KeyAST

            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(");
                        String _syntheticToInstanceName = GuiceModulesJvmModelInferrer.this.syntheticToInstanceName(b);
                        _builder.append(_syntheticToInstanceName, "\t\t\t");
                        _builder.append("());");
                        _builder.newLineIfNotEmpty();
                      } else {
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("bind.bind(key).to(");
                        KeyAST _to = b.getTo();
                        StringConcatenationClient _guiceKey_1 = GuiceModulesJvmModelInferrer.this.guiceKey(_to);
                        _builder.append(_guiceKey_1, "\t\t\t");
                        _builder.append(");");
                        _builder.newLineIfNotEmpty();
                      }
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.