Examples of EReference


Examples of org.eclipse.emf.ecore.EReference

        super(eObject, eStructuralFeatures);
      }

      protected boolean isIncluded(EStructuralFeature eStructuralFeature)
      {
        EReference eReference = (EReference)eStructuralFeature;
        return !eReference.isTransient();
      }
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

        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

        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

    }

    //FB What is the following for?
    if (feature instanceof EReference)
    {
      EReference eReference = (EReference)feature;
      if (xsdComponent != null && xsdComponent instanceof XSDParticle)
      {
        XSDTerm xsdTerm = ((XSDParticle)xsdComponent).getTerm();
        if (xsdTerm instanceof XSDElementDeclaration)
        {
          XSDTypeDefinition elementTypeDefinition = getEffectiveTypeDefinition(xsdComponent, (XSDElementDeclaration)xsdTerm);
          EClassifier eClassifier = getEClassifier(elementTypeDefinition);
          if (elementTypeDefinition instanceof XSDSimpleTypeDefinition && eClassifier instanceof EClass)
          {
            eReference.setContainment(true);
          }
        }
      }
    }
   
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

    }
    else
    {
      if (isReference)
      {
        EReference eReference = ecoreFactory.createEReference();
        eReference.setContainment(isElement);
        eReference.setEType(demandMetaData.getEObject());
        eReference.setName(name);
        eReference.setDerived(true);
        eReference.setTransient(true);
        eReference.setVolatile(true);
        documentRootEClass.getEStructuralFeatures().add(eReference);

        setFeatureKind(eReference, isElement ? ELEMENT_FEATURE : ATTRIBUTE_FEATURE);
        setNamespace(eReference, namespace);

        // Mark the bound as unspecified so that it won't be considered many
        // but can nevertheless be recognized as being unspecified and perhaps still be treat as many.
        //
        if (isElement)
        {
          eReference.setUpperBound(ETypedElement.UNSPECIFIED_MULTIPLICITY);
        }

        return eReference;
      }
      else
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

              {
                saveNil(o, entryFeature);
              }
              else
              {
                EReference referenceEntryFeature = (EReference)entryFeature;
                if (referenceEntryFeature.isContainment())
                {
                  saveElement((InternalEObject)value, entryFeature);
                }
                else if (referenceEntryFeature.isResolveProxies())
                {
                  saveFeatureMapElementReference((EObject)value, referenceEntryFeature);
                }
                else
                {
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

          EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(j);
          if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived())
          {
            if (eStructuralFeature instanceof EReference)
            {
              EReference eReference = (EReference)eStructuralFeature;
              if (!eReference.isContainment() && !eReference.isContainer())
              {
                copyReference(eReference, eObject, copyEObject);
              }
            }
            else if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
            {
              FeatureMap featureMap = (FeatureMap)eObject.eGet(eStructuralFeature);
              FeatureMap copyFeatureMap = (FeatureMap)copyEObject.eGet(getTarget(eStructuralFeature));
              int copyFeatureMapSize = copyFeatureMap.size();
              for (int k = 0, featureMapSize = featureMap.size(); k < featureMapSize; ++k)
              {
                EStructuralFeature feature = featureMap.getEStructuralFeature(k);
                if (feature instanceof EReference)
                {
                  Object referencedEObject = featureMap.getValue(k);
                  Object copyReferencedEObject = get(referencedEObject);
                  if (copyReferencedEObject == null && referencedEObject != null)
                  {
                    EReference reference = (EReference)feature;
                    if (!useOriginalReferences || reference.isContainment() || reference.getEOpposite() != null)
                    {
                      continue;
                    }
                    copyReferencedEObject = referencedEObject;
                  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

            EClass propertyEClass = (EClass)eClasses.get(propertyClass);

            if (propertyEClass != null)
            {
              // The property is another SDO, create an EReference to represent the property
              EReference reference = EcoreFactory.eINSTANCE.createEReference();
              reference.setName(propertyName);
              reference.setContainment(true);
              reference.setEType(propertyEClass);
              implEClass.getEStructuralFeatures().add(reference);

            }
            else
            {
              // The property is a List<T> and T is an SDO, created a 0..many EReference to represent the property
              if (propertyClass == List.class)
              {
                Type genericType = method.getGenericReturnType();
                if (genericType instanceof ParameterizedType)
                {
                  ParameterizedType parameterizedType = (ParameterizedType)genericType;
                  Type[] targs = parameterizedType.getActualTypeArguments();
                  if (targs.length != 0 && eClasses.containsKey(targs[0]))
                  {
                    propertyEClass = (EClass)eClasses.get(targs[0]);
                    if (propertyEClass != null)
                    {
                      EReference reference = EcoreFactory.eINSTANCE.createEReference();
                      reference.setName(propertyName);
                      reference.setContainment(true);
                      reference.setEType(propertyEClass);
                      reference.setUpperBound(-1);
                      implEClass.getEStructuralFeatures().add(reference);
                    }
                  }
                }
                continue;
View Full Code Here

Examples of org.eclipse.emf.ecore.EReference

            }
          }

          // use namespace declarations defined in the document (if any)
          EObject eRootObject = eDataGraph.getERootObject();
          EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eRootObject.eClass());
          if (xmlnsPrefixMapFeature != null)
          {
            EMap xmlnsPrefixMap = (EMap)eRootObject.eGet(xmlnsPrefixMapFeature);
            helper.setPrefixToNamespaceMap(xmlnsPrefixMap);
          }
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
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.