Examples of JVMType


Examples of com.strobel.assembler.metadata.JvmType

                else {
                    signature = instruction.getOperand(0);
                }

                final TypeReference returnType = signature.getReturnType();
                final JvmType jvmType = returnType.getSimpleType();

                if (jvmType == JvmType.Void) {
                    return 0;
                }

                return jvmType.isDoubleWord() ? 2 : 1;
            }
        }

        throw ContractUtils.unsupported();
    }
View Full Code Here

Examples of com.strobel.assembler.metadata.JvmType

        return null;
    }

    private void tryRewriteConstant(final PrimitiveExpression node, final Object value) {
        final JvmType jvmType;
        final String fieldName;

        if (value instanceof Double) {
            final double d = (double) value;

            jvmType = JvmType.Double;

            if (d == Double.POSITIVE_INFINITY) {
                fieldName = "POSITIVE_INFINITY";
            }
            else if (d == Double.NEGATIVE_INFINITY) {
                fieldName = "NEGATIVE_INFINITY";
            }
            else if (Double.isNaN(d)) {
                fieldName = "NaN";
            }
            else if (d == Double.MIN_VALUE) {
                fieldName = "MIN_VALUE";
            }
            else if (d == Double.MAX_VALUE) {
                fieldName = "MAX_VALUE";
            }
            else if (d == Double.MIN_NORMAL) {
                fieldName = "MIN_NORMAL";
            }
            else {
                return;
            }
        }
        else if (value instanceof Float) {
            final float f = (float) value;

            jvmType = JvmType.Float;

            if (f == Float.POSITIVE_INFINITY) {
                fieldName = "POSITIVE_INFINITY";
            }
            else if (f == Float.NEGATIVE_INFINITY) {
                fieldName = "NEGATIVE_INFINITY";
            }
            else if (Float.isNaN(f)) {
                fieldName = "NaN";
            }
            else if (f == Float.MIN_VALUE) {
                fieldName = "MIN_VALUE";
            }
            else if (f == Float.MAX_VALUE) {
                fieldName = "MAX_VALUE";
            }
            else if (f == Float.MIN_NORMAL) {
                fieldName = "MIN_NORMAL";
            }
            else {
                return;
            }
        }
        else if (value instanceof Long) {
            final long l = (long) value;

            jvmType = JvmType.Long;

            if (l == Long.MIN_VALUE) {
                fieldName = "MIN_VALUE";
            }
            else if (l == Long.MAX_VALUE) {
                fieldName = "MAX_VALUE";
            }
            else {
                return;
            }
        }
        else if (value instanceof Integer) {
            final int i = (int) value;

            jvmType = JvmType.Integer;

            if (i == Integer.MIN_VALUE) {
                fieldName = "MIN_VALUE";
            }
            else if (i == Integer.MAX_VALUE) {
                fieldName = "MAX_VALUE";
            }
            else {
                return;
            }
        }
        else if (value instanceof Short) {
            final short s = (short) value;

            jvmType = JvmType.Short;

            if (s == Short.MIN_VALUE) {
                fieldName = "MIN_VALUE";
            }
            else if (s == Short.MAX_VALUE) {
                fieldName = "MAX_VALUE";
            }
            else {
                return;
            }
        }
        else if (value instanceof Byte) {
            final byte b = (byte) value;

            jvmType = JvmType.Byte;

            if (b == Byte.MIN_VALUE) {
                fieldName = "MIN_VALUE";
            }
            else if (b == Byte.MAX_VALUE) {
                fieldName = "MAX_VALUE";
            }
            else {
                return;
            }
        }
        else {
            return;
        }

        final MetadataParser parser;
        final TypeDefinition currentType = context.getCurrentType();

        if (currentType != null) {
            parser = new MetadataParser(currentType);
        }
        else {
            parser = new MetadataParser(IMetadataResolver.EMPTY);
        }

        final TypeReference declaringType = parser.parseTypeDescriptor("java/lang/" + jvmType.name());
        final FieldReference field = parser.parseField(declaringType, fieldName, jvmType.getDescriptorPrefix());

        if (currentType != null &&
            node.getParent() instanceof VariableInitializer &&
            node.getParent().getParent() instanceof FieldDeclaration &&
            StringUtilities.equals(currentType.getInternalName(), declaringType.getInternalName())) {
View Full Code Here

Examples of com.strobel.assembler.metadata.JvmType

                    if (castType != null && !castType.isNull()) {
                        final TypeReference typeReference = castType.getUserData(Keys.TYPE_REFERENCE);

                        if (typeReference != null) {
                            final JvmType jvmType = typeReference.getSimpleType();

                            switch (jvmType) {
                                case Byte:
                                case Short:
                                case Character:
View Full Code Here

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

    boolean _or = false;
    boolean _isMongoPrimitiveType = this.isMongoPrimitiveType(typeRef);
    if (_isMongoPrimitiveType) {
      _or = true;
    } else {
      JvmType _type = typeRef.getType();
      boolean _isMongoBean = this.isMongoBean(_type);
      _or = _isMongoBean;
    }
    return _or;
  }
View Full Code Here

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

          StringConcatenationClient _client = new StringConcatenationClient() {
            @Override
            protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
              {
                JvmTypeReference _jvmType = MongoBeansJvmModelInferrer.this.getJvmType(property);
                JvmType _type = _jvmType.getType();
                boolean _isMongoBean = MongoBeansJvmModelInferrer.this._mongoTypes.isMongoBean(_type);
                if (_isMongoBean) {
                  _builder.append("return ");
                  _builder.append(WrappingUtil.class, "");
                  _builder.append(".wrapAndCast((");
                  _builder.append(DBObject.class, "");
                  _builder.append(") _dbObject.get(\"");
                  String _name = property.getName();
                  _builder.append(_name, "");
                  _builder.append("\"));");
                  _builder.newLineIfNotEmpty();
                } else {
                  _builder.append("return (");
                  JvmTypeReference _jvmType_1 = MongoBeansJvmModelInferrer.this.getJvmType(property);
                  JvmTypeReference _asWrapperTypeIfPrimitive = MongoBeansJvmModelInferrer.this._primitives.asWrapperTypeIfPrimitive(_jvmType_1);
                  _builder.append(_asWrapperTypeIfPrimitive, "");
                  _builder.append(") _dbObject.get(\"");
                  String _name_1 = property.getName();
                  _builder.append(_name_1, "");
                  _builder.append("\");");
                  _builder.newLineIfNotEmpty();
                }
              }
            }
          };
          MongoBeansJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _client);
        }
      };
      JvmOperation _method = this._jvmTypesBuilder.toMethod(property, _plus, _jvmType, _function);
      this._jvmTypesBuilder.<JvmOperation>operator_add(_members, _method);
      EList<JvmMember> _members_1 = inferredType.getMembers();
      String _name_1 = property.getName();
      String _firstUpper_1 = StringExtensions.toFirstUpper(_name_1);
      String _plus_1 = ("set" + _firstUpper_1);
      JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(Void.TYPE);
      final Procedure1<JvmOperation> _function_1 = new Procedure1<JvmOperation>() {
        public void apply(final JvmOperation it) {
          String _documentation = MongoBeansJvmModelInferrer.this._jvmTypesBuilder.getDocumentation(property);
          MongoBeansJvmModelInferrer.this._jvmTypesBuilder.setDocumentation(it, _documentation);
          EList<JvmFormalParameter> _parameters = it.getParameters();
          String _name = property.getName();
          JvmTypeReference _jvmType = MongoBeansJvmModelInferrer.this.getJvmType(property);
          JvmFormalParameter _parameter = MongoBeansJvmModelInferrer.this._jvmTypesBuilder.toParameter(property, _name, _jvmType);
          MongoBeansJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter);
          StringConcatenationClient _client = new StringConcatenationClient() {
            @Override
            protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
              {
                JvmTypeReference _jvmType = MongoBeansJvmModelInferrer.this.getJvmType(property);
                JvmType _type = _jvmType.getType();
                boolean _isMongoBean = MongoBeansJvmModelInferrer.this._mongoTypes.isMongoBean(_type);
                if (_isMongoBean) {
                  _builder.append("_dbObject.put(\"");
                  String _name = property.getName();
                  _builder.append(_name, "");
View Full Code Here

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

  @Extension
  private TypeReferences _typeReferences;
 
  @Check
  public void checkAnnotationIsBindingAnnotation(final XAnnotation it) {
    JvmType _annotationType = it.getAnnotationType();
    final JvmType type = _annotationType;
    boolean _matched = false;
    if (!_matched) {
      if (type instanceof JvmAnnotationType) {
        _matched=true;
        EList<JvmAnnotationReference> _annotations = ((JvmAnnotationType)type).getAnnotations();
View Full Code Here

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

    {
      StringBuilder _stringBuilder = new StringBuilder();
      final StringBuilder testsBuffer = _stringBuilder;
      final JexTestCase testCase = this._util.<JexTestCase>ancestor(sequence, JexTestCase.class);
      JvmParameterizedTypeReference _testedClass = testCase.getTestedClass();
      final JvmType testedClass = _testedClass.getType();
      final ArrayList<JvmExecutable> testedMembers = CollectionLiterals.<JvmExecutable>newArrayList();
      EList<Instance> _instances = testCase.getInstances();
      boolean _isEmpty = _instances.isEmpty();
      if (_isEmpty) {
        this.addDefaultConstructor(testedClass, testedMembers);
View Full Code Here

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

  }

  private void createCollectionClassProposals(IFXCollectionProperty prop, final EObject model, ContentAssistContext context, EReference typeReference, ICompletionProposalAcceptor acceptor) {
    IType jdtSuperType = prop.getElementType();
    if (jdtSuperType != null) {
      JvmType superType = jdtTypeProvider.findOrCreateTypeProvider(model.eResource().getResourceSet()).findTypeByName(jdtSuperType.getFullyQualifiedName());
      Filter f = new FXClassFilter(projectProvider.getJavaProject(model.eResource().getResourceSet()));
      typeProposalProviders.createSubTypeProposals(superType, this, context, typeReference, f, acceptor);
    }
  }
View Full Code Here

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

      }

      IType jdtSuperType = prop.getElementType();
      if (jdtSuperType != null) {
        final IJvmTypeProvider tProvider = jdtTypeProvider.findOrCreateTypeProvider(model.eResource().getResourceSet());
        JvmType superType = tProvider.findTypeByName(jdtSuperType.getFullyQualifiedName());
        Filter f = new FXClassFilter(projectProvider.getJavaProject(model.eResource().getResourceSet()));
        typeProposalProviders.createSubTypeProposals(superType, this, context, typeReference, f, acceptor);
      }
    }
  }
View Full Code Here

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

  }
 
  @Override
  public void completeStaticCallValueProperty_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    //TODO Should we should all classes?
    JvmType superType = jdtTypeProvider.findOrCreateTypeProvider(model.eResource().getResourceSet()).findTypeByName("javafx.scene.Parent");
    Filter f = new FXClassFilter(projectProvider.getJavaProject(model.eResource().getResourceSet()));
    typeProposalProviders.createSubTypeProposals(superType, this, context, FXGraphPackage.Literals.STATIC_CALL_VALUE_PROPERTY__TYPE, f, acceptor);
  }
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.