Package org.eclipse.emf.ecore

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


  public Object evaluate(EObject root) {
    int result = get(root);
    TreeIterator<EObject> it = root.eAllContents();
    while (it.hasNext()) {
      EObject next = it.next();
      if (ignoreClass(next.eClass()))
        continue;
     
      result += get(next);
    }
    return result;
View Full Code Here


      } else if (cur instanceof TemplateFile) {
        extra = ((TemplateFile) cur).getName();
      } else if (cur instanceof DroolsPackage) {
        extra = ((DroolsPackage) cur).getName();
      }
      parentPath = " > " + cur.eClass().getName() + "[" + extra + "]" + parentPath;        
      cur = cur.eContainer();
    }
   
    if (tag.getJavaParent() == null) {
      return tag.toString() + parentPath;
View Full Code Here

  protected Collection<EObject> removeIgnoredClasses(Collection<EObject> nodes) {
    Collection<EObject> result = new ArrayList<EObject>(nodes.size());
    Iterator<EObject> it = nodes.iterator();
    while (it.hasNext()) {
      EObject n = it.next();
      if (ignoreClass(n.eClass()))
        continue// ignore
     
      result.add(n);
    }
    return result;
View Full Code Here

          throw new SynchronizingException("Attribute in TemplateInstance is corresponding to EObject (no Attribute) in another model?");
        }
      } else {
        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

    EReference iReference = iReference2Element.getReferenceToChildren();
   
    //PatternVersion below tObject
    EObjectTraceLinkReturnContainer tObjectETLRC = findTObject(iParent);
    EObject tParent = tObjectETLRC.getTObject();
    EReference tParent2ChildRef = (EReference)tParent.eClass().getEStructuralFeature(iReference.getName());
    if(tParent2ChildRef==null){
      log.warn("Couldn't find tParentRef with name " + iReference.getName());
    }
   
//    PatternVersion tObjectPV = templateVersion.getPatternVersion(tObject, tObjectETLRC.getTraceLink().getStaticContext());
View Full Code Here

    EObjectTraceLinkReturnContainer tObjectETLRC = findTObject(iObject);
    EObject tParent = tObjectETLRC.getTObject();
    if(tParent==null){
      throw new SynchronizingException("Didn't find corresponding tObject for tiObject");
    }
    EReference tParent2ChildRef = (EReference)tParent.eClass().getEStructuralFeature(iReference2Element.getReferenceToChildren().getName());
    if(tParent2ChildRef==null){
      log.warn("Couldn't find tParentRef with name " + iReference2Element.getReferenceToChildren().getName());
    }
   
    //find tChildObject
View Full Code Here

   
    EObject eo = (EObject)o;
    //#methodCall.methodName
    String methodName = loadAttribute(methodCall, REF_METHODNAME);
   
    for(EStructuralFeature sf : eo.eClass().getEAllStructuralFeatures()){
      String sfName =sf.getName();
      sfName = sfName.substring(0,1).toLowerCase() + sfName.substring(1);
      if(sfName.matches(methodName))
        return new PlaceHolderReturnContainer(eo,sf,eo.eGet(sf));
    }
View Full Code Here

        }
      }
      //Never let tObject become IObjectProxy!
      InstanceElementProxy iReferenceProxy = new InstanceElementProxy(
          iObject,
          (EReference)iObject.eClass().getEStructuralFeature(tReference.getName()));
     
      for(EObject tObjectChild : template.getChildrenFrom(tObject, tReference, currentContext)){
        evaluate(tObjectChild, iReferenceProxy, iRootPackage);
      }
     
View Full Code Here

            eObject.eClass().getName()));
    //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());
View Full Code Here

      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()){
        List<EObject> copiedObjectChildList = (List<EObject>)copiedObject.eGet(copiedRef);
        for(EObject eObjectChild : (List<EObject>)eObject.eGet(eRef)){
          copiedObjectChildList.add(copyElement(eObjectChild, copiedRef.getEReferenceType().getEPackage()));
        }
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.