Package org.eclipse.xtext.common.types

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


   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetController(JvmTypeReference newController, NotificationChain msgs)
  {
    JvmTypeReference oldController = controller;
    controller = newController;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FXGraphPackage.COMPONENT_DEFINITION__CONTROLLER, oldController, newController);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here


   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetType(JvmTypeReference newType, NotificationChain msgs)
  {
    JvmTypeReference oldType = type;
    type = newType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FXGraphPackage.CONST_VALUE_PROPERTY__TYPE, oldType, newType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

    TreeIterator<EObject> _allContents = resource.getAllContents();
    Iterable<EObject> _iterable = IteratorExtensions.<EObject>toIterable(_allContents);
    Iterable<ClassCloner> _filter_1 = Iterables.<ClassCloner>filter(_iterable, ClassCloner.class);
    for (final ClassCloner cc : _filter_1) {
      {
        JvmTypeReference _classToClone = cc.getClassToClone();
        final String clonedClassSimpleName = _classToClone.getSimpleName();
        String _elvis_1 = null;
        String _name_1 = cc.getName();
        if (_name_1 != null) {
          _elvis_1 = _name_1;
        } else {
View Full Code Here

   * Generate content for root and sub cloners: apply() method and all sub-cloners (if any)
   */
  public CharSequence generateApplyMethodAndSubCloners(final ContainerType container) {
    CharSequence _xblockexpression = null;
    {
      JvmTypeReference _javaType = container.getJavaType();
      JvmTypeReference _typeOrCollectionTypeParameter = this._reflectionUtils.getTypeOrCollectionTypeParameter(_javaType);
      final String containerType = _typeOrCollectionTypeParameter.getQualifiedName();
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("public ");
      _builder.append(containerType, "");
      _builder.append(" apply(");
      _builder.append(containerType, "");
View Full Code Here

   * Items are transfered one by one.
   */
  public CharSequence generateCollectionFieldClonnerMethod(final SimpleField field) {
    CharSequence _xblockexpression = null;
    {
      JvmTypeReference _javaType = field.getJavaType();
      final String collectionType = _javaType.getQualifiedName();
      JvmTypeReference _javaType_1 = field.getJavaType();
      JvmTypeReference _typeOrCollectionTypeParameter = this._reflectionUtils.getTypeOrCollectionTypeParameter(_javaType_1);
      final String collectionItemType = _typeOrCollectionTypeParameter.getQualifiedName();
      StringConcatenation _builder = new StringConcatenation();
      _builder.newLine();
      _builder.append("private ");
      _builder.append(collectionType, "");
      _builder.append(" ");
      String _fieldName = field.getFieldName();
      String _firstLower = StringExtensions.toFirstLower(_fieldName);
      _builder.append(_firstLower, "");
      _builder.append("CollectionCloner(");
      _builder.append(collectionType, "");
      _builder.append(" thisCollection, ");
      _builder.append(collectionType, "");
      _builder.append(" otherCollection) {");
      _builder.newLineIfNotEmpty();
      _builder.append("\t");
      _builder.append("if (otherCollection == null) return null;");
      _builder.newLine();
      _builder.append("\t");
      JvmTypeReference _javaType_2 = field.getJavaType();
      CharSequence _createCollection = this.createCollection(_javaType_2);
      _builder.append(_createCollection, "\t");
      _builder.newLineIfNotEmpty();
      _builder.append("\t");
      _builder.append("for (");
View Full Code Here

   * Items are transfered one by one calling sub-cloner apply() method.
   */
  public CharSequence generateCollectionComplexFieldClonnerMethod(final ComplexField field) {
    CharSequence _xblockexpression = null;
    {
      JvmTypeReference _javaType = field.getJavaType();
      final String collectionType = _javaType.getQualifiedName();
      JvmTypeReference _javaType_1 = field.getJavaType();
      JvmTypeReference _typeOrCollectionTypeParameter = this._reflectionUtils.getTypeOrCollectionTypeParameter(_javaType_1);
      final String collectionItemType = _typeOrCollectionTypeParameter.getQualifiedName();
      StringConcatenation _builder = new StringConcatenation();
      _builder.newLine();
      _builder.append("private ");
      _builder.append(collectionType, "");
      _builder.append(" ");
      String _fieldName = field.getFieldName();
      String _firstLower = StringExtensions.toFirstLower(_fieldName);
      _builder.append(_firstLower, "");
      _builder.append("CollectionCloner(");
      _builder.append(collectionType, "");
      _builder.append(" thisCollection, ");
      _builder.append(collectionType, "");
      _builder.append(" otherCollection) {");
      _builder.newLineIfNotEmpty();
      _builder.append("\t");
      _builder.append("if (otherCollection == null) return null;");
      _builder.newLine();
      _builder.append("\t");
      JvmTypeReference _javaType_2 = field.getJavaType();
      CharSequence _createCollection = this.createCollection(_javaType_2);
      _builder.append(_createCollection, "\t");
      _builder.newLineIfNotEmpty();
      _builder.append("\t");
      _builder.append("for (");
View Full Code Here

   * @param clazz List<a.b.m.Section>
   * @return fully qualified name, example: "a.b.m.Section"
   */
  public String getTypeParameter(JvmTypeReference clazz) {
    if (clazz==null) return null;
    JvmTypeReference paramTypeClazz = typeReferences.getArgument(clazz, 0);
    return paramTypeClazz.getQualifiedName();
  }
View Full Code Here

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetClassToClone(JvmTypeReference newClassToClone, NotificationChain msgs)
  {
    JvmTypeReference oldClassToClone = classToClone;
    classToClone = newClassToClone;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeepClonePackage.CLASS_CLONER__CLASS_TO_CLONE, oldClassToClone, newClassToClone);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetJavaType(JvmTypeReference newJavaType, NotificationChain msgs)
  {
    JvmTypeReference oldJavaType = javaType;
    javaType = newJavaType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeepClonePackage.BASE_TYPE__JAVA_TYPE, oldJavaType, newJavaType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

          rootCloner.setJavaType(reflectionUtils
            .createDefensiveCopyOfJvmTypeReference(JVM_UNKNOWN_TYPE));         
        }
      } else if (child instanceof FieldClonerType) {
        FieldClonerType fieldCloner = (FieldClonerType) child;
        JvmTypeReference parentType = ((ContainerType) fieldCloner
            .eContainer()).getJavaType();
        JvmField jvmField = reflectionUtils.getField(
            parentType.getType(), fieldCloner.getFieldName());
        if (jvmField != null) {
          fieldCloner.setJavaType(reflectionUtils
            .createDefensiveCopyOfJvmTypeReference(
                reflectionUtils.getTypeOrCollectionTypeParameter(jvmField.getType())));
        } else {
View Full Code Here

TOP

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

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.