Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EAttribute


  {
    if (isOpen == type.isOpen()) return;

    if (isOpen)
    {
      EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
      ((EClass)type).getEStructuralFeatures().add(eAttribute);

      eAttribute.setName("any");
      eAttribute.setUnique(false);
      eAttribute.setUpperBound(ETypedElement.UNBOUNDED_MULTIPLICITY);
      eAttribute.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
      ExtendedMetaData.INSTANCE.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
      ExtendedMetaData.INSTANCE.setProcessingKind(eAttribute, ExtendedMetaData.LAX_PROCESSING);
      ExtendedMetaData.INSTANCE.setWildcards(eAttribute, Collections.singletonList("##any"));
     
      if (type.isSequenced()) {
        eAttribute.setDerived(true);
        eAttribute.setTransient(true);
        eAttribute.setVolatile(true);
      }
    }
    else
    {
      EClass eClass = (EClass)type;
      EAttribute any = (EAttribute)eClass.getEStructuralFeature("any");
      eClass.getEStructuralFeatures().remove(any)
    }
  }
View Full Code Here


    }
   
    if (isSequenced) {
      EClass eClass = (EClass)type;
      ExtendedMetaData.INSTANCE.setContentKind(eClass, ExtendedMetaData.MIXED_CONTENT);
      EAttribute mixedFeature = EcoreFactory.eINSTANCE.createEAttribute();
      mixedFeature.setName("mixed");
      mixedFeature.setUnique(false);
      mixedFeature.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
      mixedFeature.setLowerBound(0);
      mixedFeature.setUpperBound(-1);
      eClass.getEStructuralFeatures().add(mixedFeature);
      ExtendedMetaData.INSTANCE.setFeatureKind(mixedFeature, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
      ExtendedMetaData.INSTANCE.setName(mixedFeature, ":mixed");
    }
    else
View Full Code Here

  {
    EClass documentRootEClass = EcoreFactory.eINSTANCE.createEClass();
    ExtendedMetaData.INSTANCE.setName(documentRootEClass, "");
    ExtendedMetaData.INSTANCE.setContentKind(documentRootEClass, ExtendedMetaData.MIXED_CONTENT);
   
    EAttribute mixed = EcoreFactory.eINSTANCE.createEAttribute();
    mixed.setName("mixed");
    mixed.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
    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();
View Full Code Here

   * <!-- end-user-doc -->
   * @generated NOT
   */
  public Sequence getSequence()
  {
    EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature(eClass());
    return mixedFeature != null ? (Sequence)eGet(mixedFeature, true, false) : null;
  }
View Full Code Here

   * <!-- end-user-doc -->
   * @generated NOT
   */
  public Sequence getOldSequence(DataObject dataObject)
  {
    EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature((EClass)dataObject.getType());
    if (mixedFeature != null)
    {
      return (Sequence)getOldValue(dataObject, (Property)mixedFeature).getValue();
    }
    return null;
View Full Code Here

                }
                continue;
              }

              // The property is a regular Java type / not an SDO, create an EAttribute to represent it
              EAttribute attribute = EcoreFactory.eINSTANCE.createEAttribute();
              attribute.setName(propertyName);
              EDataType dataType = (EDataType)TypeHelper.INSTANCE.getType(propertyClass);
              attribute.setEType(dataType);
              implEClass.getEStructuralFeatures().add(attribute);
            }
          }
        }
      }
View Full Code Here

                }
                continue;
              }

              // The property is a regular Java type / not an SDO, create an EAttribute to represent it
              EAttribute attribute = EcoreFactory.eINSTANCE.createEAttribute();
              attribute.setName(propertyName);
              EDataType dataType = (EDataType)TypeHelper.INSTANCE.getType(propertyClass);
              attribute.setEType(dataType);
              implEClass.getEStructuralFeatures().add(attribute);
            }
          }
        }
      }
View Full Code Here

  {
    EClass documentRootEClass = EcoreFactory.eINSTANCE.createEClass();
    ExtendedMetaData.INSTANCE.setName(documentRootEClass, "");
    ExtendedMetaData.INSTANCE.setContentKind(documentRootEClass, ExtendedMetaData.MIXED_CONTENT);
   
    EAttribute mixed = EcoreFactory.eINSTANCE.createEAttribute();
    mixed.setName("mixed");
    mixed.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
    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();
View Full Code Here

   * <!-- end-user-doc -->
   * @generated NOT
   */
  public Sequence getOldSequence(DataObject dataObject)
  {
    EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature((EClass)dataObject.getType());
    if (mixedFeature != null)
    {
      return (Sequence)getOldValue(dataObject, (Property)mixedFeature).getValue();
    }
    return null;
View Full Code Here

    int propertyNumber = documentRootEClass.getEStructuralFeatures().size();

    EStructuralFeature globalProperty;
    if(asAttribute) {
      createEAttribute(documentRootEClass, propertyNumber);
      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);
View Full Code Here

TOP

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

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.