Examples of EAttribute


Examples of org.eclipse.emf.ecore.EAttribute

    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

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"));
     
      //FB TBD Add an "anyAttribute" EAttribute as well.
     
      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

Examples of org.eclipse.emf.ecore.EAttribute

    }
   
    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

Examples of org.eclipse.emf.ecore.EAttribute

   * <!-- 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

Examples of org.eclipse.emf.ecore.EAttribute

        buf.append(count);
        buf.append("</td><td class=\"percent pct").append(pct).append("\">");
        buf.append(pct);
        // if it's an attribute
        if (ft instanceof EAttribute) {
          EAttribute attr = (EAttribute) ft;
          int counta = state.uniqueAttributes.getUniqueAttributes(cls, attr);
          buf.append("</td><td class=\"unique uniq").append(counta).append("\">");
          buf.append(counta);
        } else {
          buf.append("</td><td class=\"unique\">");
        }
        buf.append("</td></tr>\n");
       
      }

      // get all the defined supertypes first
      for (EClass supertype : sortedClasses(cls.getEAllSuperTypes())) {
        int c2 = state.supertypeUsageMap.getUsage(cls, supertype);
        String pct2 = getPercent(c2, c3);
       
        buf.append("<tr class=\"super class\"><th class=\"name\">");
        if (supertype.isAbstract() || supertype.isInterface()) buf.append("<i>");
        buf.append(supertype.getName());
        if (supertype.isAbstract() || supertype.isInterface()) buf.append("</i>");
        buf.append("</th><td class=\"instances count").append(c2).append("\">");
        buf.append(c2);
        buf.append("</td><td class=\"percent pct").append(pct2).append("\">");
        buf.append(pct2);
        buf.append("</td><td class=\"unique\">");
        buf.append("</td></tr>\n");
       
        // for every local structural feature
        for (EStructuralFeature ft : sortedFeatures(supertype.getEStructuralFeatures())) {
          int count = state.featureCount.getFeatureInstanceCount(cls, ft);
          String pct = getPercent(count, c2);
         
          buf.append("<tr class=\"feature\">");
          buf.append("<th class=\"name\">");
          buf.append(ft.getName());
          buf.append("</th><td class=\"instances count").append(count).append("\">");
          buf.append(count);
          buf.append("</td><td class=\"percent pct").append(pct).append("\">");
          buf.append(pct);
          // if it's an attribute
          if (ft instanceof EAttribute) {
            EAttribute attr = (EAttribute) ft;
            int counta = state.uniqueAttributes.getUniqueAttributes(cls, attr);
            buf.append("</td><td class=\"unique uniq").append(counta).append("\">");
            buf.append(counta);
          } else {
            buf.append("</td><td class=\"unique\">");
View Full Code Here

Examples of org.eclipse.emf.ecore.EAttribute

//    return name!=null?name:wrapped.eClass().getName();
    String name = "";
    String type = "";
   
    if(eo==null) return null;
    EAttribute nameAtt = (EAttribute)eo.eClass().getEStructuralFeature("name");
    if(nameAtt!=null) name =(String)eo.eGet(nameAtt,true);
   
    type = eo.eClass().getName();
    return name + " ("+type+")";
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EAttribute

   
    type = eo.eClass().getName();
    return name + " ("+type+")";
  }
  public static String getElementName(EObject eo){
    EAttribute nameAtt = (EAttribute)eo.eClass().getEStructuralFeature("name");
    if(nameAtt!=null) return (String)eo.eGet(nameAtt,true);
    return "";
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EAttribute

          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

Examples of org.eclipse.emf.ecore.EAttribute

 
  protected void unifyAttributes(EObject tObject, EObject iObject, IContext context) throws SimTLException{
    log.debug("Unify attributes of " + Util.getFullName(iObject) + "("+iObject.eClass().getEAllAttributes().size()+")");
    for(EAttribute iAtt : iObject.eClass().getEAllAttributes()){
      log.debug("Unify attribute " + iAtt.getName());
      EAttribute tAtt = (EAttribute)tObject.eClass().getEStructuralFeature(iAtt.getName());
      if(tAtt==null){
        throw new InjectionException("tiObject has an eAttribute which doesn't exist in tObject: " + iAtt.getName()
            +". Size of attributeList in class of tObject: " +tObject.eClass().getEAttributes().size());
      }
     
View Full Code Here

Examples of org.eclipse.emf.ecore.EAttribute

   * @param tAttributeClass The attribute (has name and all) in template
   * @param tObject The templateObject which contains this attribute in template
   * @param tiObject The respective eObject in template instance corresponding to the <code>tObject</code>
   */
  private void evaluateTAttribute(EAttribute tAttributeClass, EObject tObject, EObject iObject) throws SimTLException{
    EAttribute iAttributeClass = (EAttribute)iObject.eClass().getEStructuralFeature(tAttributeClass.getName());
    if(iAttributeClass==null){
      throw new InjectionException("No tiAttributeClass found for tAttributeClass " + tObject.eClass().getName()+"."+tAttributeClass.getName());
    }
    //TODO validate that not both attribute and placeholder are set
   
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.