Examples of JvmTypeReference


Examples of org.eclipse.xtext.common.types.JvmTypeReference

  public JvmOperation inferActionMethod(final StateTestContext stateTestContext, final TransitionExpressionAction action) {
    JvmOperation _xblockexpression = null;
    {
      String _relativeName = this._util.<JexTestSequence>relativeName(action, JexTestSequence.class);
      String _plus = ("_transition_exprAction_" + _relativeName);
      JvmTypeReference _newTypeRef = this._jvmTypesBuilder.newTypeRef(action, void.class);
      final JvmOperation method = this.inferTestHelperMethod(stateTestContext, _plus, _newTypeRef, action);
      XExpression _expr = action.getExpr();
      this._iJvmModelAssociator.associateLogicalContainer(_expr, method);
      final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() {
        public void apply(final ITreeAppendable it) {
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

 
  public JvmOperation inferTestHelperMethod(final StateTestContext innerStateTestContext, final String name, final JvmTypeReference type, final EObject context) {
    final Procedure1<JvmOperation> _function = new Procedure1<JvmOperation>() {
      public void apply(final JvmOperation it) {
        it.setVisibility(JvmVisibility.PRIVATE);
        final JvmTypeReference instanceType = JexTestJvmModelInferrer.this._util.jvmInstanceType(context);
        boolean _notEquals = (!Objects.equal(instanceType, null));
        if (_notEquals) {
          EList<JvmFormalParameter> _parameters = it.getParameters();
          String _string = XbaseScopeProvider.IT.toString();
          JvmFormalParameter _parameter = JexTestJvmModelInferrer.this._jvmTypesBuilder.toParameter(context, _string, instanceType);
          JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter);
        }
        StateTestContext stateTestContext = innerStateTestContext;
        if ((stateTestContext instanceof StateFunction)) {
          EList<Parameter> _parameters_1 = ((StateFunction) stateTestContext).getParameters();
          JexTestJvmModelInferrer.this.initParameters(it, _parameters_1);
          StateTestContext _ancestor = JexTestJvmModelInferrer.this._util.<StateTestContext>ancestor(stateTestContext, StateTestContext.class);
          stateTestContext = _ancestor;
        }
        if ((stateTestContext instanceof JexTestSequence)) {
          EList<Instance> _instances = ((JexTestSequence) stateTestContext).getInstances();
          for (final Instance instance : _instances) {
            EList<JvmFormalParameter> _parameters_2 = it.getParameters();
            String _name = instance.getName();
            JvmTypeReference _jvmType = JexTestJvmModelInferrer.this._util.jvmType(instance);
            JvmFormalParameter _parameter_1 = JexTestJvmModelInferrer.this._jvmTypesBuilder.toParameter(instance, _name, _jvmType);
            JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters_2, _parameter_1);
          }
        }
      }
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

  public JvmOperation inferTestHelperMethod(final StateTestContext stateTestContext, final String prefix, final EObject context, final Procedure1<? super ITreeAppendable> initializer) {
    JvmOperation _xblockexpression = null;
    {
      String _relativeName = this._util.<JexTestSequence>relativeName(context, JexTestSequence.class);
      String _plus = (prefix + _relativeName);
      JvmTypeReference _newTypeRef = this._jvmTypesBuilder.newTypeRef(context, void.class);
      final JvmOperation method = this.inferTestHelperMethod(stateTestContext, _plus, _newTypeRef, context);
      final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() {
        public void apply(final ITreeAppendable it) {
          initializer.apply(it);
        }
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

  }
 
  public ITreeAppendable generateLocalInstance(final Instance instance, final ITreeAppendable appendable) {
    ITreeAppendable _xblockexpression = null;
    {
      final JvmTypeReference instanceType = this._util.jvmType(instance);
      this._typeReferenceSerializer.serialize(instanceType, instance, appendable);
      StringConcatenation _builder = new StringConcatenation();
      _builder.append(" ");
      String _name = instance.getName();
      _builder.append(_name, " ");
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

    }
    appendable.newLine();
  }
 
  public void inferPropertiesTestMethods(final PropertiesTest pt, final JvmGenericType jvmClass) {
    final JvmTypeReference returnType = this._jvmTypesBuilder.newTypeRef(pt, void.class);
    StateTestContext _ancestor = this._util.<StateTestContext>ancestor(pt, StateTestContext.class);
    String _relativeName = this._util.<StateTestContext>relativeName(pt, StateTestContext.class);
    String _plus = ("_test_" + _relativeName);
    final JvmOperation propertiesMethod = this.inferTestHelperMethod(_ancestor, _plus, returnType, ((EObject) pt));
    this._iJvmModelAssociator.associateLogicalContainer(pt, propertiesMethod);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

  }
 
  public void generateAssertCall(final EObject owner, final XExpression expr, final ITreeAppendable appendable, final boolean explicitBoolean) {
    List<XExpression> exprs = Collections.<XExpression>unmodifiableList(Lists.<XExpression>newArrayList(expr));
    String assertMethodName = null;
    JvmTypeReference _elvis = null;
    JvmTypeReference _jvmType = this._util.jvmType(expr, owner);
    if (_jvmType != null) {
      _elvis = _jvmType;
    } else {
      JvmTypeReference _newTypeRef = this._jvmTypesBuilder.newTypeRef(owner, void.class);
      _elvis = ObjectExtensions.<JvmTypeReference>operator_elvis(_jvmType, _newTypeRef);
    }
    final JvmTypeReference type = _elvis;
    String _qualifiedName = type.getQualifiedName();
    final boolean isVoid = Objects.equal(_qualifiedName, "void");
    String _qualifiedName_1 = type.getQualifiedName();
    final boolean isLogical = Objects.equal(_qualifiedName_1, "boolean");
    boolean _or = false;
    if ((expr instanceof XUnaryOperation)) {
      _or = true;
    } else {
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetSingleType(JvmTypeReference newSingleType, NotificationChain msgs)
  {
    JvmTypeReference oldSingleType = singleType;
    singleType = newSingleType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FXBeanPackage.VALUE_LIST_TYPE_DEF__SINGLE_TYPE, oldSingleType, newSingleType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetKeyType(JvmTypeReference newKeyType, NotificationChain msgs)
  {
    JvmTypeReference oldKeyType = keyType;
    keyType = newKeyType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FXBeanPackage.MAP_TYPE_DEF__KEY_TYPE, oldKeyType, newKeyType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetValueType(JvmTypeReference newValueType, NotificationChain msgs)
  {
    JvmTypeReference oldValueType = valueType;
    valueType = newValueType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FXBeanPackage.MAP_TYPE_DEF__VALUE_TYPE, oldValueType, newValueType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmTypeReference

                Bean _bean_2 = u.getBean();
                String _name_1 = _bean_2.getName();
                _builder.append(_name_1, "  ");
                _builder.append(",ObservableList<");
                ValueListTypeDef _valDef_1 = this.valDef(p);
                JvmTypeReference _singleType = _valDef_1.getSingleType();
                String _shortName = this.shortName(_singleType);
                _builder.append(_shortName, "  ");
                _builder.append(">,");
                ValueListTypeDef _valDef_2 = this.valDef(p);
                JvmTypeReference _singleType_1 = _valDef_2.getSingleType();
                String _shortName_1 = this.shortName(_singleType_1);
                _builder.append(_shortName_1, "  ");
                _builder.append("> ");
                String _name_2 = p.getName();
                String _upperCase = _name_2.toUpperCase();
                _builder.append(_upperCase, "  ");
                _builder.append(" = new EFXListProperty<");
                Bean _bean_3 = u.getBean();
                String _name_3 = _bean_3.getName();
                _builder.append(_name_3, "  ");
                _builder.append(",ObservableList<");
                ValueListTypeDef _valDef_3 = this.valDef(p);
                JvmTypeReference _singleType_2 = _valDef_3.getSingleType();
                String _shortName_2 = this.shortName(_singleType_2);
                _builder.append(_shortName_2, "  ");
                _builder.append(">,");
                ValueListTypeDef _valDef_4 = this.valDef(p);
                JvmTypeReference _singleType_3 = _valDef_4.getSingleType();
                String _shortName_3 = this.shortName(_singleType_3);
                _builder.append(_shortName_3, "  ");
                _builder.append(">(\"");
                String _name_4 = p.getName();
                _builder.append(_name_4, "  ");
                _builder.append("\",ObservableList.class,");
                ValueListTypeDef _valDef_5 = this.valDef(p);
                JvmTypeReference _singleType_4 = _valDef_5.getSingleType();
                String _shortName_4 = this.shortName(_singleType_4);
                _builder.append(_shortName_4, "  ");
                _builder.append(".class,");
                boolean _isReadonly = p.isReadonly();
                _builder.append(_isReadonly, "  ");
                _builder.append(",");
                boolean _isLazy = p.isLazy();
                _builder.append(_isLazy, "  ");
                _builder.append(");");
                _builder.newLineIfNotEmpty();
              } else {
                _builder.append("\t");
                _builder.append("public static final EFXProperty<");
                Bean _bean_4 = u.getBean();
                String _name_5 = _bean_4.getName();
                _builder.append(_name_5, "  ");
                _builder.append(",");
                ValueListTypeDef _valDef_6 = this.valDef(p);
                JvmTypeReference _singleType_5 = _valDef_6.getSingleType();
                String _objectShortType = this.objectShortType(_singleType_5);
                _builder.append(_objectShortType, "  ");
                _builder.append("> ");
                String _name_6 = p.getName();
                String _upperCase_1 = _name_6.toUpperCase();
                _builder.append(_upperCase_1, "  ");
                _builder.append(" = new EFXProperty<");
                Bean _bean_5 = u.getBean();
                String _name_7 = _bean_5.getName();
                _builder.append(_name_7, "  ");
                _builder.append(",");
                ValueListTypeDef _valDef_7 = this.valDef(p);
                JvmTypeReference _singleType_6 = _valDef_7.getSingleType();
                String _objectShortType_1 = this.objectShortType(_singleType_6);
                _builder.append(_objectShortType_1, "  ");
                _builder.append(">(\"");
                String _name_8 = p.getName();
                _builder.append(_name_8, "  ");
                _builder.append("\",");
                ValueListTypeDef _valDef_8 = this.valDef(p);
                JvmTypeReference _singleType_7 = _valDef_8.getSingleType();
                String _shortName_5 = this.shortName(_singleType_7);
                _builder.append(_shortName_5, "  ");
                _builder.append(".class,");
                boolean _isReadonly_1 = p.isReadonly();
                _builder.append(_isReadonly_1, "  ");
                _builder.append(",");
                boolean _isLazy_1 = p.isLazy();
                _builder.append(_isLazy_1, "  ");
                _builder.append(");");
                _builder.newLineIfNotEmpty();
              }
            }
          } else {
            _builder.append("\t");
            _builder.append("public static final EFXMapProperty<?,?,");
            MapTypeDef _mapDef = this.mapDef(p);
            JvmTypeReference _keyType = _mapDef.getKeyType();
            String _shortName_6 = this.shortName(_keyType);
            _builder.append(_shortName_6, "  ");
            _builder.append(",");
            MapTypeDef _mapDef_1 = this.mapDef(p);
            JvmTypeReference _valueType = _mapDef_1.getValueType();
            String _shortName_7 = this.shortName(_valueType);
            _builder.append(_shortName_7, "  ");
            _builder.append("> ");
            String _name_9 = p.getName();
            String _upperCase_2 = _name_9.toUpperCase();
            _builder.append(_upperCase_2, "  ");
            _builder.append(" = new EFXMapProperty<?,?,");
            MapTypeDef _mapDef_2 = this.mapDef(p);
            JvmTypeReference _keyType_1 = _mapDef_2.getKeyType();
            String _shortName_8 = this.shortName(_keyType_1);
            _builder.append(_shortName_8, "  ");
            _builder.append(",");
            MapTypeDef _mapDef_3 = this.mapDef(p);
            JvmTypeReference _valueType_1 = _mapDef_3.getValueType();
            String _shortName_9 = this.shortName(_valueType_1);
            _builder.append(_shortName_9, "  ");
            _builder.append(">(\"");
            String _name_10 = p.getName();
            _builder.append(_name_10, "  ");
            _builder.append("\");");
            _builder.newLineIfNotEmpty();
          }
        }
      }
    }
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("public static final EFXBeanClass<");
    Bean _bean_6 = u.getBean();
    String _name_11 = _bean_6.getName();
    _builder.append(_name_11, "  ");
    _builder.append("> CLAZZ;");
    _builder.newLineIfNotEmpty();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("List<EFXFeature<");
    Bean _bean_7 = u.getBean();
    String _name_12 = _bean_7.getName();
    _builder.append(_name_12, "    ");
    _builder.append(",?>> features = new ArrayList<EFXFeature<");
    Bean _bean_8 = u.getBean();
    String _name_13 = _bean_8.getName();
    _builder.append(_name_13, "    ");
    _builder.append(",?>>();");
    _builder.newLineIfNotEmpty();
    {
      Bean _bean_9 = u.getBean();
      EList<BeanPropertyDecl> _properties_1 = _bean_9.getProperties();
      for(final BeanPropertyDecl p_1 : _properties_1) {
        _builder.append("\t\t");
        _builder.append("features.add(");
        String _name_14 = p_1.getName();
        String _upperCase_3 = _name_14.toUpperCase();
        _builder.append(_upperCase_3, "    ");
        _builder.append(");");
        _builder.newLineIfNotEmpty();
      }
    }
    _builder.append("\t\t");
    _builder.append("CLAZZ = new EFXBeanClass<");
    Bean _bean_10 = u.getBean();
    String _name_15 = _bean_10.getName();
    _builder.append(_name_15, "    ");
    _builder.append(">(features);");
    _builder.newLineIfNotEmpty();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("public static void set(");
    Bean _bean_11 = u.getBean();
    String _name_16 = _bean_11.getName();
    _builder.append(_name_16, "  ");
    _builder.append(" bean, EFXProperty<");
    Bean _bean_12 = u.getBean();
    String _name_17 = _bean_12.getName();
    _builder.append(_name_17, "  ");
    _builder.append(",?> feature, Object value) {");
    _builder.newLineIfNotEmpty();
    _builder.append("\t\t");
    _builder.append("switch( feature.name ) {");
    _builder.newLine();
    {
      Bean _bean_13 = u.getBean();
      EList<BeanPropertyDecl> _properties_2 = _bean_13.getProperties();
      final Function1<BeanPropertyDecl,Boolean> _function = new Function1<BeanPropertyDecl,Boolean>() {
          public Boolean apply(final BeanPropertyDecl p) {
            boolean _isReadonly = p.isReadonly();
            boolean _not = (!_isReadonly);
            return Boolean.valueOf(_not);
          }
        };
      Iterable<BeanPropertyDecl> _filter = IterableExtensions.<BeanPropertyDecl>filter(_properties_2, _function);
      for(final BeanPropertyDecl p_2 : _filter) {
        {
          TypeDef _type_1 = p_2.getType();
          if ((_type_1 instanceof ValueListTypeDef)) {
            {
              TypeDef _type_2 = p_2.getType();
              JvmTypeReference _singleType_8 = ((ValueListTypeDef) _type_2).getSingleType();
              boolean _isPrimitiveType = this.isPrimitiveType(_singleType_8);
              if (_isPrimitiveType) {
                {
                  TypeDef _type_3 = p_2.getType();
                  JvmTypeReference _singleType_9 = ((ValueListTypeDef) _type_3).getSingleType();
                  String _qualifiedName = _singleType_9.getQualifiedName();
                  boolean _equals = _qualifiedName.equals("int");
                  if (_equals) {
                    _builder.append("\t\t\t");
                    _builder.append("case \"");
                    String _name_18 = p_2.getName();
                    _builder.append(_name_18, "      ");
                    _builder.append("\" : bean.set");
                    String _name_19 = p_2.getName();
                    String _firstUpper = StringExtensions.toFirstUpper(_name_19);
                    _builder.append(_firstUpper, "      ");
                    _builder.append("(((Number)value).intValue()); return;");
                    _builder.newLineIfNotEmpty();
                  } else {
                    _builder.append("\t\t\t");
                    _builder.append("case \"");
                    String _name_20 = p_2.getName();
                    _builder.append(_name_20, "      ");
                    _builder.append("\" : bean.set");
                    String _name_21 = p_2.getName();
                    String _firstUpper_1 = StringExtensions.toFirstUpper(_name_21);
                    _builder.append(_firstUpper_1, "      ");
                    _builder.append("(((Number)value).doubleValue()); return;");
                    _builder.newLineIfNotEmpty();
                  }
                }
              } else {
                _builder.append("\t\t\t");
                _builder.append("case \"");
                String _name_22 = p_2.getName();
                _builder.append(_name_22, "      ");
                _builder.append("\" : bean.set");
                String _name_23 = p_2.getName();
                String _firstUpper_2 = StringExtensions.toFirstUpper(_name_23);
                _builder.append(_firstUpper_2, "      ");
                _builder.append("((");
                TypeDef _type_4 = p_2.getType();
                JvmTypeReference _singleType_10 = ((ValueListTypeDef) _type_4).getSingleType();
                String _shortName_10 = this.shortName(_singleType_10);
                _builder.append(_shortName_10, "      ");
                _builder.append(")value); return;");
                _builder.newLineIfNotEmpty();
              }
            }
          }
        }
      }
    }
    _builder.append("\t\t\t");
    _builder.append("default: throw new IllegalArgumentException(\"Unknown feature \'\"+feature.name+\"\'\");");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("public static <R> R get(");
    Bean _bean_14 = u.getBean();
    String _name_24 = _bean_14.getName();
    _builder.append(_name_24, "  ");
    _builder.append(" bean, EFXProperty<");
    Bean _bean_15 = u.getBean();
    String _name_25 = _bean_15.getName();
    _builder.append(_name_25, "  ");
    _builder.append(",?> feature) {");
    _builder.newLineIfNotEmpty();
    _builder.append("\t\t");
    _builder.append("switch( feature.name ) {");
    _builder.newLine();
    {
      Bean _bean_16 = u.getBean();
      EList<BeanPropertyDecl> _properties_3 = _bean_16.getProperties();
      final Function1<BeanPropertyDecl,Boolean> _function_1 = new Function1<BeanPropertyDecl,Boolean>() {
          public Boolean apply(final BeanPropertyDecl p) {
            boolean _isReadonly = p.isReadonly();
            boolean _not = (!_isReadonly);
            return Boolean.valueOf(_not);
          }
        };
      Iterable<BeanPropertyDecl> _filter_1 = IterableExtensions.<BeanPropertyDecl>filter(_properties_3, _function_1);
      for(final BeanPropertyDecl p_3 : _filter_1) {
        {
          TypeDef _type_5 = p_3.getType();
          JvmTypeReference _singleType_11 = ((ValueListTypeDef) _type_5).getSingleType();
          boolean _isPrimitiveType_1 = this.isPrimitiveType(_singleType_11);
          if (_isPrimitiveType_1) {
            {
              TypeDef _type_6 = p_3.getType();
              JvmTypeReference _singleType_12 = ((ValueListTypeDef) _type_6).getSingleType();
              String _qualifiedName_1 = _singleType_12.getQualifiedName();
              boolean _equals_1 = _qualifiedName_1.equals("int");
              if (_equals_1) {
                _builder.append("\t\t\t");
                _builder.append("case \"");
                String _name_26 = p_3.getName();
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.