Package org.eclipse.xtext.common.types

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


          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

  @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

    {
      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

  }

  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

      }

      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

  }
 
  @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

    }
  }
 
  @Override
  public void completeComponentDefinition_RootNode(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    JvmType superType = jdtTypeProvider.findOrCreateTypeProvider(model.eResource().getResourceSet()).findTypeByName("javafx.scene.Parent");
    typeProposalProviders.createSubTypeProposals(superType, this, context, FXGraphPackage.Literals.COMPONENT_DEFINITION__ROOT_NODE, acceptor);
  }
View Full Code Here

  public String shortName(final JvmTypeReference r) {
    String _xblockexpression = null;
    {
      StringBuilder _stringBuilder = new StringBuilder();
      final StringBuilder builder = _stringBuilder;
      JvmType _type = r.getType();
      this.manager.appendType(_type, builder);
      String _string = builder.toString();
      _xblockexpression = (_string);
    }
    return _xblockexpression;
View Full Code Here

    StringConcatenation _builder = new StringConcatenation();
    {
      boolean _notEquals = (!Objects.equal(controller, null));
      if (_notEquals) {
        _builder.append(" controlledby ");
        JvmType _type = controller.getType();
        String _simpleName = _type.getSimpleName();
        _builder.append(_simpleName, "");
      }
    }
    return _builder;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.common.types.JvmType

Copyright © 2018 www.massapicom. 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.