Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EObject.eSet()


        {
          ((List)oldContainer.eGet(oldContainmentReference)).add(oldContainmentIndex, rootObject);
        }
        else
        {
          oldContainer.eSet(oldContainmentReference, rootObject);
        }
      }
    }
    else if (documentRoot != null)
    {
View Full Code Here


        {
          ((List)oldContainer.eGet(oldContainmentReference)).add(oldContainmentIndex, rootObject);
        }
        else
        {
          oldContainer.eSet(oldContainmentReference, rootObject);
        }
      }
    }
    else if (documentRoot != null)
    {
View Full Code Here

      // TODO what if containerFeature is not many?
      throw new IllegalArgumentException("Cannot do anything with the structural feature: " + containerFeature);
    }

    // we now need to set its source feature
    object.eSet(sourceFeature, source);
   
    // we now need to set its target feature
    object.eSet(targetFeature, target);

    return object;
View Full Code Here

    // we now need to set its source feature
    object.eSet(sourceFeature, source);
   
    // we now need to set its target feature
    object.eSet(targetFeature, target);

    return object;
   
  }
View Full Code Here

        if(corrTLN.isAttribute()){
          EObject tObject = corrTLN.getAttribute().getParent();
          EAttribute tAtt = (EAttribute)tObject.eClass().getEStructuralFeature(iPointer2Att.getEAttribute().getName());
          if(tAtt==null) throw new SynchronizingException("No AttributeReference found with name " + iPointer2Att.getEAttribute().getName());

          tObject.eSet(tAtt, newValue);
        }
      }
    }
  }
 
View Full Code Here

      //Set condition to false, and if negateValue then to true!
      //XOR
      newValue = !(bValue&&negate)&&(bValue||negate);
    }
    log.info("Set " + pPointer2Att + " to " + newValue);
    pParent.eSet(pAtt,newValue);
  }
 
  public void removeElement(EObject pElement, ReferenceFromParent pointerToList) throws SimTLException{
    log.debug("Remove element from parameterModel: " + Util.getFullName(pElement));
    List<?> parameterList = (List<?>)pointerToList.getReferencedValue();
View Full Code Here

    //findInPackageAndInstantiate(eObject.eClass().getName(),copiedObjectRootPackage);
   
    //copy attributes
    for(EAttribute eAtt : eObject.eClass().getEAllAttributes()){
      EAttribute copiedAtt = (EAttribute)copiedObject.eClass().getEStructuralFeature(eAtt.getName());
      copiedObject.eSet(copiedAtt, eObject.eGet(eAtt));
    }
    //copy references
    for(EReference eRef : eObject.eClass().getEAllReferences()){
      EReference copiedRef = (EReference)copiedObject.eClass().getEStructuralFeature(eRef.getName());
      if(eRef.isMany()){
View Full Code Here

        List<EObject> copiedObjectChildList = (List<EObject>)copiedObject.eGet(copiedRef);
        for(EObject eObjectChild : (List<EObject>)eObject.eGet(eRef)){
          copiedObjectChildList.add(copyElement(eObjectChild, copiedRef.getEReferenceType().getEPackage()));
        }
      } else {
        copiedObject.eSet(copiedRef, copyElement((EObject)eObject.eGet(eRef),copiedRef.getEReferenceType().getEPackage()));
      }
    }
    return copiedObject;
  }
 
View Full Code Here

    List<EObject> classMembers = (List<EObject>)javaClass.eGet(memberFeature);
    assert(Util.getElementName(classMembers.get(1)).matches("p1"));
   
    EObject fieldP1 = classMembers.get(1);
    EObject fieldP4 = EObjectCopier.copyElement(fieldP1, fieldP1.eClass().getEPackage());
    fieldP4.eSet(fieldP4.eClass().getEStructuralFeature("name"),"p4");
    classMembers.add(2, fieldP4);
    SimTLFactory.createInterpreter().interprete(
        template,
        URI.createFileURI(new File("output/TV_templateInstance_NewIteration.java").getAbsolutePath()));
  }
View Full Code Here

    List<EObject> classMembers = (List<EObject>)javaClass.eGet(memberFeature);
    assert(Util.getElementName(classMembers.get(2)).matches("p2"));
   
    EObject fieldP2 = classMembers.get(2);
    EObject fieldP4 = EObjectCopier.copyElement(fieldP2, fieldP2.eClass().getEPackage());
    fieldP4.eSet(fieldP4.eClass().getEStructuralFeature("name"),"p4");
    classMembers.add(0, fieldP4);
   
    //Look at templateInstance_ManyAddAlloc.java
    SimTLFactory.createInterpreter().interprete(
        template,
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.