Examples of EReference


Examples of org.eclipse.emf.ecore.EReference

    mixed.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
    ExtendedMetaData.INSTANCE.setName(mixed, ":mixed");
    ExtendedMetaData.INSTANCE.setFeatureKind(mixed, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
    documentRootEClass.getEStructuralFeatures().add(mixed);
   
    EReference xmlnsPrefixMap = EcoreFactory.eINSTANCE.createEReference();
    xmlnsPrefixMap.setName("xMLNSPrefixMap");
    xmlnsPrefixMap.setEType(EcorePackage.eINSTANCE.getEStringToStringMapEntry());
    xmlnsPrefixMap.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
    xmlnsPrefixMap.setContainment(true);
    xmlnsPrefixMap.setTransient(true);
    ExtendedMetaData.INSTANCE.setName(xmlnsPrefixMap, "xmlns:prefix");
    ExtendedMetaData.INSTANCE.setFeatureKind(xmlnsPrefixMap, ExtendedMetaData.ATTRIBUTE_FEATURE);
    documentRootEClass.getEStructuralFeatures().add(xmlnsPrefixMap);
   
    EReference xsiSchemaLocation = EcoreFactory.eINSTANCE.createEReference();
    xsiSchemaLocation.setName("xSISchemaLocation");
    xsiSchemaLocation.setEType(EcorePackage.eINSTANCE.getEStringToStringMapEntry());
    xsiSchemaLocation.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
    xsiSchemaLocation.setContainment(true);
    xsiSchemaLocation.setTransient(true);
    ExtendedMetaData.INSTANCE.setName(xsiSchemaLocation, "xsi:schemaLocation");
    ExtendedMetaData.INSTANCE.setFeatureKind(xsiSchemaLocation, ExtendedMetaData.ATTRIBUTE_FEATURE);
    documentRootEClass.getEStructuralFeatures().add(xsiSchemaLocation);
   
    return documentRootEClass;
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

        // HACK: We need some SDOUtil extension to understand a property is derived
        if (property instanceof ReferenceImpl) {
            ReferenceImpl r = (ReferenceImpl) property;
            if (r.isTransient())
                return true;
            EReference opposite = r.getEOpposite();
            if (opposite != null && opposite.isContainment()) {
                return true;
            }
        } else if (property instanceof AttributeImpl) {
            AttributeImpl a = (AttributeImpl) property;
            if (a.isTransient())
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

      EAttribute gatt = (EAttribute)documentRootEClass.getEStructuralFeatures().get(propertyNumber);
      initEAttribute(gatt, (EDataType)type, name, null, 0, -2, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED);
      globalProperty = gatt;
    } else {
      createEReference(documentRootEClass, propertyNumber);
      EReference gref = (EReference)documentRootEClass.getEStructuralFeatures().get(propertyNumber);
      initEReference(gref, (EClass)type, null, name, null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
      globalProperty = gref;
    }
    addAnnotation((ENamedElement)globalProperty, annotationSource, xsdMappings);
    return (Property) globalProperty;
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

    for (EdgeType typ : EdgeTypes.getAllEdgeTypes()) {
      // WireSource
      if (typ.getEdgeSource().isInstance(g)) {
        // find the EOpposite (outWires)
        EReference opposite = typ.getFromOpposite();
       
        // get results as a list
        List<Object> edges = new ArrayList<Object>();
        if (opposite.isMany()) {
          List<?> e2 = (List<?>) g.eGet(opposite);
          for (Object e : e2)
            edges.add(e);
        } else {
          edges.add(g.eGet(opposite));
        }
               
        for (Object edge : edges) {
          // if it's a NON-generated element that has been generated, add it to the list
          if (edge instanceof GeneratedElement) {
            GeneratedElement edge2 = (GeneratedElement) edge;
           
            if (!edge2.isIsGenerated()) {
              EReference target = typ.getToRef();
             
              Object reverse = edge2.eGet(target);
              if (reverse == null)
                continue;
             
              if (!(reverse instanceof EObject)) {
                throw new IllegalArgumentException("Object '" + reverse + "' is not an EObject, resolved reference = '" + target + "' of edgeType " + typ);
              }
              result.put(edge2, (EObject) reverse);
            }
          }
        }
      }
     
      // WireDestination
      if (typ.getEdgeDestination().isInstance(g)) {
        // find the EOpposite (inWires)
        EReference opposite = typ.getToOpposite();
       
        // get results as a list
        List<Object> edges = new ArrayList<Object>();
        if (opposite.isMany()) {
          List<?> e2 = (List<?>) g.eGet(opposite);
          for (Object e : e2)
            edges.add(e);
        } else {
          edges.add(g.eGet(opposite));
        }
               
        for (Object edge : edges) {
          // if it's a NON-generated element that has been generated, add it to the list
          if (edge instanceof GeneratedElement) {
            GeneratedElement edge2 = (GeneratedElement) edge;
           
            if (!edge2.isIsGenerated()) {
              EReference target = typ.getFromRef();
             
              Object reverse = edge2.eGet(target);
              if (reverse == null)
                continue;
             
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

    log.debug("\n" +
        " --------------\n" +
        "| ADD-LOCATION |\n" +
        " --------------");
    EObject iParent = iReference2Element.getParent();
    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

Examples of org.eclipse.emf.ecore.EReference

    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

Examples of org.eclipse.emf.ecore.EReference

   
    EObject tChild = null;
    if(addAllocation instanceof PositionAddAllocation){
      PositionAddAllocation pAddAlloc = (PositionAddAllocation)addAllocation;
      EObject tParent = pAddAlloc.getTParent();
      EReference tParent2tChildRef = pAddAlloc.getReferenceFromParent();
      IContext context = pAddAlloc.getReferencedContext();
      Integer position = pAddAlloc.getPosition();
     
      tChild = EObjectCopier.copyElement(
          iChild,
          tParent2tChildRef.getEReferenceType().getEPackage());
      if(tChild==null){
        log.error("Child is null!");
      }
     
     
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

      tRightRep = addAllocationsTillCap(false, tRight, tRightContext, commonAncistor, tiChild,elementsInRange);
    }
    //then in between tLeftRep and tRightRep below commonAncistor
//    log.info("Found tLeftRep: " + Util.getFullName(tLeftRep) + " and tRightRep: " + Util.getFullName(tRightRep));
   
    EReference commonAncistor2ChildRef = (EReference)commonAncistor.eClass().getEStructuralFeature(tParent2ChildRef.getName());
    if(commonAncistor2ChildRef==null){
      throw new SimTLException("tElementReference doesn't have the name than tParent to tChildReference.");
    }
    //Up here both contexts could be used
    addAllocationsBetweenTLeftRepAndTRightRepUnderCommonAncistor(commonAncistor, commonAncistor2ChildRef, tLeftRep, tRightRep, tiChild, tLeftContext, elementsInRange);
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

      throws SimTLException{
    Reference2Element tReference2Element =  template.getParentFrom(tObject, context);
    EObject tParent = tReference2Element.getParent();
    AllocationType allocationType = findAllocationType(tParent);
   
    EReference tP2cRef = tReference2Element.getReferenceToChildren();
    if(tParent==cap){
      return tObject; //directly under cap is handled elsewhere
    }
   
    //leftToRight => start to collect when hit tObject
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

    } else {
      unifyAttributes(tObject,iObject,context);
     
      log.warn("Unifying Children recurisively - Not yet implemented");
      for(EReference tiReference : iObject.eClass().getEAllReferences()){
        EReference tReference = (EReference)tObject.eClass().getEStructuralFeature(tiReference.getName());
        for(EObject tObjectChild: template.getChildrenFrom(tObject, tReference, context)){
         
         
          // FIXME !!!!!!!!!
          // TODO!!!!!!!!!!!!!!!
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.