Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EReference


  private ReferenceFromParent checkPlaceholder(EAttribute tAttributeClass, EAttribute iAttributeClass, EObject tObject, EObject iObject) throws SimTLException{
    //check usual naming scheme
    //TODO extend if usual naming scheme doesn't work out anymore (name => name_PH)
    String possibleName = TPlaceholder.attributeToPlaceHolder(tAttributeClass.getName());
    //log.info("Check Placeholder: " + possibleName);
    EReference tReferenceClass = (EReference)tObject.eClass().getEStructuralFeature(possibleName);
    if(tReferenceClass == null) return null; // no placeholder
   
//    for(EReference tReferenceClass : tObject.eClass().getEAllReferences()){
//      if(tReferenceClass.getName().matches(possibleName)){
        if(tAttributeClass.isMany()){
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()));
        }
      } else {
        copiedObject.eSet(copiedRef, copyElement((EObject)eObject.eGet(eRef),copiedRef.getEReferenceType().getEPackage()));
      }
    }
    return copiedObject;
  }
View Full Code Here

   */
  @Override
  public Reference2Element getParentFrom(EObject child, IContext context) throws SimTLException{
    if(child==null) return null;
    EObject parent = child.eContainer(); //Language is build that containment is always activated
    EReference reference = child.eContainmentFeature();
    return new Reference2Element(parent, reference,context,this);
  }
View Full Code Here

    mixed.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
    ExtendedMetaData.INSTANCE.setName(mixed, ":mixed");
    ExtendedMetaData.INSTANCE.setFeatureKind(mixed, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
    documentRootEClass.getEStructuralFeatures().add(mixed);
   
    EReference xmlnsPrefixMap = (EReference)SDOFactory.eINSTANCE.createReference();
    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 = (EReference)SDOFactory.eINSTANCE.createReference();
    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

            return false;
        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

   
    public String getAttributeValue(EObject element, String referencedModel, String attribute)
    {
        if( element == null || referencedModel == null || attribute == null ) return null;
       
        EReference ref = getReference(element, referencedModel);
               
        if( ref != null && ref.getUpperBound() == 1 )
        {
            EObject model = (EObject) element.eGet(ref);   
            return getAttributeValue(model, attribute);
        }
       
View Full Code Here

   
    public String getAttributeValue(EObject element, String referencedModel, String attribute)
    {
        if( element == null || referencedModel == null || attribute == null ) return null;
       
        EReference ref = getReference(element, referencedModel);
               
        if( ref != null && ref.getUpperBound() == 1 )
        {
            EObject model = (EObject) element.eGet(ref);   
            return getAttributeValue(model, attribute);
        }
       
View Full Code Here

    Object oldValue = msg.getOldValue();
    Object newValue = msg.getNewValue();

    if (eClass().getEAllReferences().contains(feature))
    {
      EReference eReference = (EReference)feature;
      if (eReference.isContainment() && !eReference.isTransient())
      {
        switch (eventType)
        {
          case Notification.ADD:
          {
View Full Code Here

    changeReference(null);

    Object obj = null;
    for (Iterator containments = eClass().getEAllContainments().iterator(); containments.hasNext();)
    {
      EReference eReference = (EReference)containments.next();
      if (eReference == WSDLPackage.Literals.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA)
      {
        // TBD - This is an instance of XSDSchemaExtensibilityElement and
        // eRefernce is XSDSchema. What do we want to do for update?
      }
      else if (!eReference.isTransient())
      {
        if (eReference.isMany())
        {
          for (Iterator objects = ((Collection)eGet(eReference)).iterator(); objects.hasNext();)
          {
            obj = objects.next();
            if (!(obj instanceof WSDLElement) || obj == null)
View Full Code Here

      return new FeatureIteratorImpl(eObject, eStructuralFeatures);
    }

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

TOP

Related Classes of org.eclipse.emf.ecore.EReference

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.